Pagination Issue when total rows not divisible exactly by lengthMenu property
Pagination Issue when total rows not divisible exactly by lengthMenu property
Link to test case:
Debugger code (debug.datatables.net): Debugger not working, returns "DevTools failed to load source map: Could not load content for https://debug.datatables.net/dist/css/maps/debug.css.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE"
Error messages shown: None
Description of problem: I have a data table that returns 10 rows, and the lengthMenu is set to 7, I cant access the last 3 rows by using the pagination "next" or clicking on the "2" in the pagination of my data tables. I cant replicate the issue in a test case as it works expectedly everywhere except our development teams project.
The most curious part of it all is that if I change the lengthMenu to be 5 instead of 7 (or any number divisible by the amount of rows returned) then the pagination works perfectly. I've been told this is a reoccuring issue but we cant seem to find anything online to help out.
Any help/advice would be much appreciated.
Thankyou.
Jack
This question has an accepted answers - jump to answer
Answers
Do you get errors in the browser's console when the problem happens?
With 10 rows I would expect that you don't have server side processing enabled but do you have it enabled?
Can you post a link to your page so we can help debug?
Kevin
Hi Kevin,
Thanks for your reply.
No errors appear within the console when this happens. Server side processing is also not enabled. Unfortunately the page is hosted internally and therefore can't be shared.
Understandably I can imagine its hard to help without this, which I can appreciate but we thought it's worth a shot anyway!
Thankyou
Jack
Have you also set the
pageLength
option? It will need to be set to match your customisedlengthMenu
.Allan
Hi Allan,
That seemed to have worked. Thankyou for the helpful advice and the prompt reply that is really appreciated.
Kind Regards,
Jack