pagination not working with datatable 1.10.7

pagination not working with datatable 1.10.7

vnokhvnokh Posts: 2Questions: 1Answers: 0

hello,

i am using DataTable 1.10.7 with jQuery 2.1.4

This is my code of initialization:

var dt = $('#tbl-users').DataTable({
"processing": true,
"bServerSide": true,
"sAjaxSource": "ManageUsers",
"aoColumns": [
{
......................
...................
});

This is data returned by server side:

{"sEcho":1,"iTotalRecords":22,"iTotalDisplayRecords":10,"aaData":[{......}]}

It always shows "Showing 1 to 10 of 10 entries" and contain only one pagination button.

Please guide me to fix this problem.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,691Questions: 1Answers: 10,500 Site admin
    Answer ✓

    iTotalRecords and iTotalDisplayRecords records should only be different if there is a filter applied to the table.

    As the legacy documentation notes (since you are using the legacy parameter sAjaxSource for whatever reason):

    iTotalRecords - Total records, before filtering (i.e. the total number of records in the database)

    iTotalDisplayRecords - Total records, after filtering (i.e. the total number of records after filtering has been applied - not just the number of records being returned in this result set)

    Allan

  • vnokhvnokh Posts: 2Questions: 1Answers: 0

    Thank you, it solved my problem

This discussion has been closed.