How does server-side pagination work?
How does server-side pagination work?
I setup my table for server-side processing, but it loads all of my data on one page. I was looking at the example script for server-side, and it looks like the section for paging is just setting a LIMIT for the SQL Query. Is that accurate? Not in code terms, but in talking terms, is Paging just a limit of so many results and DataTables is just smart enough to throw that into paging? Same kind of questions go for Ordering and Filtering...are they just things that are appended to the SQL query to get the results?
This discussion has been closed.
Replies
Yes :-)
> is Paging just a limit of so many results and DataTables is just smart enough to throw that into paging?
Yes
> Same kind of questions go for Ordering and Filtering...are they just things that are appended to the SQL query to get the results?
Yes again :-).
Because of the way the SQL statement is constructed, you can basically build up the components of the query, breaking them down as you have. Take for example pagination - we know that we have, say 120 records in a table. Page length is 10 and we want page 2, so a limit / offset is all we need to get the 10 records needed for the second page. Without paging, we'd just get the whole data set.
Regards,
Allan