How to enjoy both Server-Side paging, and Client-Side sorting/filtering etc.
How to enjoy both Server-Side paging, and Client-Side sorting/filtering etc.
Hi,
I am using datatables for a large DB (which means ServerSide processing is a must).
On every page I am displaying 50 records, and on page-changes I am fetching the next 50 records from the server.
Up to here, everything works fine.
when I'm clicking on a column header to try and sort, instead of sorting the 50 records on the clientside (directly from the DOM), datatables makes another AJAX call for the server, asking it to provide the current page sorted by field 'X'.
If I turn off server-side processing, datatables expects the server to give it (datatables) all the data, and it will handle all the sorting/paging on client-side, but, because of the massive amount of records the browser collapses... :(
Isn't there a way to combine Server-Side processing for paging and fetching part of the records every time, and use DataTables to sort just the records displayed on each page on the client side??
Thanks in advance,
Shay
I am using datatables for a large DB (which means ServerSide processing is a must).
On every page I am displaying 50 records, and on page-changes I am fetching the next 50 records from the server.
Up to here, everything works fine.
when I'm clicking on a column header to try and sort, instead of sorting the 50 records on the clientside (directly from the DOM), datatables makes another AJAX call for the server, asking it to provide the current page sorted by field 'X'.
If I turn off server-side processing, datatables expects the server to give it (datatables) all the data, and it will handle all the sorting/paging on client-side, but, because of the massive amount of records the browser collapses... :(
Isn't there a way to combine Server-Side processing for paging and fetching part of the records every time, and use DataTables to sort just the records displayed on each page on the client side??
Thanks in advance,
Shay
This discussion has been closed.
Replies
How many rows are you working with - if <50'000, then have you considered using client-side processing with deferred rendering enabled?
If >50'000, then yes, server-side processing is going to be requires, and needs to implement all of the features you want (including sorting and filtering).
Allan