Datatables 1.10 paging only shows page number 1

datatable, javascript, jquery

Solution

The problem seemed to be that recordsFiltered should be the number of records which were filtered by the query. I've searched for the answer during more than 2 hours; feeling really dumb now... ;)

Problem

I'm using jQuery DataTables v1.10. At our new website we have a dataset with more than 10000 records. The displayLength is set by default at 50 records. After initializing the DataTable, 50 of 10000+ records are showing, but there's only 1 pagination item visible and a forward and backward arrow which are both disabled. When I'm changing the displayLength to 100, I get one page with 100 records out of 10000+, but still one page instead of more than 100 pages. This is our initialisation: ``` "oLanguage": oDatatablesNL, "sDom": '<"dt-toolbar clearfix"fpl>rt<"row-actions"><"dt-toolbar bottom clearfix"p>', "processing": true, "serverSide": true, "ajax": "/?async=yes&get=datatable, "ordering": true, "order": [[ 4, "asc" ]], "paging": true, "pagingType": "full_numbers", "displayStart": 0, "lengthMenu": [[50, 100, 500], [50, 100, 500]], "lengthChange": true, "searching": true, //"deferRender": true, "columns": [ { "data": "firstColumn", "class": "first" }, { "data": "secondColumn", "class": "second" }, ], "createdRow": function( row, data, dataIndex ) { dtUpdateData(row, data, dataIndex); }, "initComplete": function() { dtExtras(dtLengths); } ``` And our serverside data: ``` {"draw":1,"recordsTotal":"15827","recordsFiltered":"50","data":[{'column1':'test','column2':'test2'}] ```

Original source