Lazy Loading with Sorting
Lazy Loading with Sorting
Hi, @allan
Long time no see, I really got a lot of help last year.
I'm back with a new question.
My table will apply lazy loading.
Instead of server side processing, I will use a method that calls the server api (using axios) and fetches it every time a certain portion is output.
Is there a way to use lazy loading and sorting together?
If it is not possible to mix them in the current method, can lazy loading and sorting be used together in the server side processing method?
Thank you always.
Sol
Answers
Hi Sol,
Good to hear form you again. Sorting will work just fine with server-side processing (example), assuming that the server-side script applies the sorting condition that DataTables gives it.
You say you aren't using server-side processing though? Perhaps you can provide a link to what you are currently doing? If you are loading chunks of data, you can then add them to the DataTable using
rows.add()
and they would be sorted client-side. But if you want it sorted overall, the chunks would already need to be sorted.Allan