Server side processing is breaking paging

Server side processing is breaking paging

uttamkuttamk Posts: 5Questions: 1Answers: 0
edited February 2015 in Free community support

I am using .net MVC to populate datatable .But page number are not correct

''' "serverSide": true,
"ajax": //somePath",
"deferLoading": "100",
"pageLength": "25",
"pagingType": "full_numbers", '''

from server I am returning ''' data = Result, recordsTotal = gridData.Total, recordsFiltered = gridData.Results.Count()'''

On first page it is showing correctly but when I am moving to 2nd page it shows incorrect info in footer
''' "Showing 26 to 99 of 99 entries (filtered from 105 total entries)" and only 1 and 2 page are enable rest are disabled '''.

Also if I move to next page using next button it display weird info
''' "Showing 0,251 to 99 of 99 entries (filtered from 105 total entries)" '''

Please let me know where I am lacking

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,686Questions: 1Answers: 10,500 Site admin

    Can you link to a test page showing the issue as noted in the forum rules in future please?

    It sounds like the recordsTotal and recordsFiltered options aren't being returned as required. If you can't link to the page, can you use the debugger so we can see the JSON data at least?

    Thanks,
    Allan

  • uttamkuttamk Posts: 5Questions: 1Answers: 0

    I have used debugger and the code is "iqafit " wil it help or you need more information please let me know

  • allanallan Posts: 63,686Questions: 1Answers: 10,500 Site admin

    The debug trace shows that the information shown is:

    Showing 26 to 50 of 262 entries (filtered from 931 total entries)

    Which is correct for the data returned:

        "recordsTotal": 931,
        "recordsFiltered": 262,
    

    Allan

  • uttamkuttamk Posts: 5Questions: 1Answers: 0

    Allen that page have two grid " Table (#ClaimsGrid)" and Table (#WorkQueueGrid).
    Problem is with Table (#ClaimsGrid when we moves to 2nd page
    I apologize for giving incomplete data . This is new debug info Debug code - "ikejav"
    "recordsTotal": 105,
    "recordsFiltered": 99,

    Draws 4
    Columns 11
    Rows 25
    Display start row 25
    Display length 25

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

    Oops - thanks!

    You have:

    "pageLength": "25",

    and

    "deferLoading": "100"

    But the documentation for both have them as integers rather than strings (pageLength and deferLoading.

    Make them numbers rather than strings and that should help.

    Allan

  • uttamkuttamk Posts: 5Questions: 1Answers: 0

    It works Thanks Allan

This discussion has been closed.