Skip to content Skip to sidebar Skip to footer

Datatables Showing Duplicate Pagination And Search Controls

I am having issues with using a second DataTables object on a different page. I have successfully created a DataTable that sits on a page within my Web App. It all looks fine and

Solution 1:

There's a slight error in the DataTable instantiation. The correct way to instantiate DataTables is using the lowercase selector.dataTable like this:

$('#ticketsTable').dataTable(...)

The syntax selector.DataTable() is used for DataTable API calls e.g:

$('#ticketsTable').DataTable().rows('.modified').invalidate().draw();

Solution 2:

Possibly this solution may fix your issue, Set data-turbolinks to false in the tables

<table id="myTable" data-turbolinks="false">
 /* Insert table content... */
</table> 

If you are using the below code for creating datatable,

<script>
 $(document).ready(function(){
     $('#myTable').dataTable({ });
 })
</script>

Post a Comment for "Datatables Showing Duplicate Pagination And Search Controls"