Pagination not loading properly

Pagination not loading properly

kashifaukashifau Posts: 9Questions: 2Answers: 0

When the page loads the initial number of pages are shown as 209 which is incorrect, but when I click any of the column for sorting e.g id the paging is correctly set to 69 pages. Where can I change this functionality to correctly load the number of pages the first time.

Answers

  • kthorngrenkthorngren Posts: 19,891Questions: 26Answers: 4,691

    re you using server side processing? If yes then it sounds like your server script is not returning the correct paging information as documented in the Server side processing docs.

    Please provide more information about your environment like the Datatbles config. better is to provide a link to your page or a test case replicating the issue. Or possibly provide the developers with the debugger information.
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Kevin

  • colincolin Posts: 15,094Questions: 1Answers: 2,581

    That shouldn't happen. We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

  • kashifaukashifau Posts: 9Questions: 2Answers: 0

    I am taking over from the previous dev and getting myself familiar with Datatables. We are using CakePHP and customized implementation of Datatables. I am not yet familiar with all the settings but I will try to create a test case. In the meantime, could you please guide which particular file I should look for where paging information is loaded into the view. Thanks!

  • kthorngrenkthorngren Posts: 19,891Questions: 26Answers: 4,691

    If you have serverSide processing enabled in the Datatables options then the paging is controlled by the server script called by the ajax URL.

    Kevin

  • kashifaukashifau Posts: 9Questions: 2Answers: 0

    I have found the issue. Paging was being set using recordsTotal, changing it to recordsFiltered fixed the issue. Thanks for your help and guidance.

Sign In or Register to comment.