Pagination next button is not working, generates url with start parameter value 010 instead of 10

Pagination next button is not working, generates url with start parameter value 010 instead of 10

martinfehermartinfeher Posts: 4Questions: 1Answers: 0

After clicking on the next pagination button, pagination is not working. It generates ajax url with start parameter value 010 instead of 10.
It is using server side processing. Datatables version 1.13.1

This question has accepted answers - jump to:

Answers

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

    It generates ajax url with start parameter value 010 instead of 10.

    Something somewhere is treating one of the paging numbers as a string. Can you use the debugger to give me a trace please - click the Upload button and then let me know what the debug code is.

    Allan

  • martinfehermartinfeher Posts: 4Questions: 1Answers: 0

    Hi Allan, the javascript snippet was run on the page. The image with a result is in the attachment.
    I had problems with getting the trace, there was no Upload button. How is it possible to get the trace from the debugger and add it here? Is there any info we can get to fix it?
    Thanks,

  • kthorngrenkthorngren Posts: 21,459Questions: 26Answers: 4,975
    edited December 2022 Answer ✓

    When you click Upload configuration data you don't get the Upload button? You should see this after clicking Upload configuration data.

    Then you will get the ID for Allan.

    Kevin

  • martinfehermartinfeher Posts: 4Questions: 1Answers: 0
    edited December 2022

    After clicking on Upload configuration data there is the message below with a link, no Upload button. Is that the information needed? Thanks

    Upload complete - ihosij
    Your debug code is shown above...

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

    Thank you. In the state that is being loaded it has:

            "start": "010",
            "length": "10",
    

    That's the problem - the state being restored has those two values as strings. They must be integers. In your fnStateLoadCallback you could use parseInt() to make sure you pass back integers.

    Allan

  • martinfehermartinfeher Posts: 4Questions: 1Answers: 0

    It has fixed the problem. Thank you

  • sandeepsisandeepsi Posts: 3Questions: 0Answers: 0

    I have same problem with DataTables 1.13.4.. but looks like fnStateLoadCallback is not available in fnStateLoadCallback. how i can resolve this issue

  • sandeepsisandeepsi Posts: 3Questions: 0Answers: 0

  • sandeepsisandeepsi Posts: 3Questions: 0Answers: 0

    I did update Data tables to new version but I can reproduce this issue

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

    stateLoadParams can be used. Please link to a test case showing the issue if you are unable to resolve the issue.

    Allan

Sign In or Register to comment.