Data Tables showing wrong pagination limits when used with server side processing

Data Tables showing wrong pagination limits when used with server side processing

atul_kumaratul_kumar Posts: 3Questions: 0Answers: 0
edited February 2014 in DataTables 1.9
I am using data tables 1.9 for the first time and facing an issue. I am trying to use server side processing with ajax along with pagination. Data is loading perfectly well, but system is showing weird pagination limits. Upon data load system shows this message "Showing 1 to 10 of 10 entries (filtered from 1,418 total entries)" and my next button is disabled with only one page (with 10 results) to show.

It shows that system has correctly loaded first 10 results, but is not ready to load rest of 1408 results. can somebody please help me out in this?
You can get more information here:
http://debug.datatables.net/agubom

Replies

  • allanallan Posts: 63,489Questions: 1Answers: 10,470 Site admin
    Thanks for the debug trace. Your return from the server shows:

    [code]
    "iTotalRecords": "13",
    "iTotalDisplayRecords": "10",
    [/code]

    From the server-side processing documentation ( http://datatables.net/usage/server-side ):

    > 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)

    I suspect that is what is wrong here.

    Allan
  • atul_kumaratul_kumar Posts: 3Questions: 0Answers: 0
    Hi Allan, thanks alot. That worked. iTotalDisplayRecords was not correct in my response. Thanks again.
This discussion has been closed.