Pagination not loading properly
Pagination not loading properly
kashifau
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
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
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
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!
If you have
serverSide
processing enabled in the Datatables options then the paging is controlled by the server script called by theajax
URL.Kevin
I have found the issue. Paging was being set using recordsTotal, changing it to recordsFiltered fixed the issue. Thanks for your help and guidance.