problem paging with server side

problem paging with server side

jmlmjmlm Posts: 1Questions: 1Answers: 0

Debugger code (debug.datatables.net): axiyix
Error messages shown: No Error message

Hi,
I've got a problem with paging and server side.
Paging works well without serverside but only show me the "1" button with serverside

Here is the response of the ajax request (the data is hidden):

{
    "data": [
        {
          ...
        },
        {
          ...
        },
        {
          ...
        },
        {
          ...
        },
        {
          ...
        },
        {
          ...
        },
        {
          ...
        },
        {
          ...
        },
        {
          ...
        },
        {
          ...
        }
    ],
    "draw": 1,
    "recordsFiltered": 10,
    "recordsTotal": 33
}

Regards

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,629Questions: 26Answers: 5,010
    Answer ✓

    It looks like that response is the result of a search that is returning 10 records out of 33. Assuming you have the default page length 10 then the paging element should only have one page listed.

    I'm guessing you don't have a search happening at this time so the problem is likely that the recordsFiltered value should be 33 instead of 10. See the Serverside processing protocol docs for details of the parameters used for serverside processing. Specifically ecordsFiltered states this:

    Total records, after filtering (i.e. the total number of records after filtering has been applied - not just the number of records being returned for this page of data).

    Kevin

Sign In or Register to comment.