Question about a problem related to DataTables Paging ...
Question about a problem related to DataTables Paging ...
vikinik01
Posts: 4Questions: 3Answers: 0
Hey, I have a minor issue related to showing entries when paginating using DataTables. When I choose the 25
entries option, a call to the backend is made which successfully returns 25 items, however DataTables is still only showing 10 of them and also there's still only 1 page insteead of the expected 3 (note that I'm showing 10 items per page). What could be causing this problem? Thnaks in advance.
Answers
draw: 1
is very likely the issue. Thedraw
parameter should be the same as what is sent to the server as part of the request (make sure you cast / parse it as an integer for security). See the manual here for details.Allan
This example is working properly. Screenshots are very difficult to troubleshoot Is the screenshot with the JSON response after you changed the page length to 25? If so the problem is with the response as it has
draw: 1
. Since this is the second request to the server it should havedraw: 2
. It is basically a sequence number. See the Server Side Processing docs for more details.If this doesn't help then please post a link to your page or a test case replicating the issue so we can help debug.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
Yup, I successfuly fixed it. Thank you very much for the instantenous feedback!