Server-side | customize pagination
Server-side | customize pagination
Link to test case:
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem: Greetings, I hope you are very well.
Currently I am using datatables to display data in a table but I realized that the data was growing and the loading of the table is getting slower. I would like to rely on the server-side property so that in each sheet, it queries the server for the data of that second sheet and so on. I'm trying to do it but he always asks me about the same page. Can you help me to personalize my ajax url and be able to send the sheet number?
This question has accepted answers - jump to:
Answers
That's not how server-side processing is configured. For server-side processing, enable
serverSide
. The protocol is discussed here. Also see examples here. If you download the DataTables repo, there are examples of the server-side scripts here,Cheers,
Colin
Unfortunately I had not read the documentation correctly.
Now, after reading, I am relying on the "draw" property to configure my server and return the information of the corresponding page.
Thanks a lot.
Sorry, I still have the problem.
How can I tell the server which page is next?
If I use the "draw" property, it keeps increasing but if I go back in the pages, "draw" keeps increasing.
I need to know which is the next page to fetch that information from the server.
The
draw
property is a sequence number not a page number. The Server Side Processing protocol describes thestart
andlength
parameters which tell the server script the page to fetch. You can derive the 0 based page number, in your server script, from these parameters like thispage = start / length
.Or you can use a Datatables supplied server side processing script. See this blog describing how to use them.
Kevin
Thank you very much. I came to that conclusion lol.
so i left it
You might be able to simplify the code into one statement:
Glad you got it working though
Kevin
finally it was like this. Thanks, you're a crack