Ajax Request For Server Side Data For Each Page In Datatables
I am using Jquery Datatables to load an array of array of data (aaData) obtained via ajax call from server side. I don't want to pull whole of the data at once rather I need to mak
Solution 1:
In datatables server-side processing every click on 'prev'/'next' button (also filter, sorting etc) call request (out of the box) to function specified in sAjaxSource property - you can check this call in your browser console.
Call have lot of usefull parameters. You need to use iDisplayLength
and iDisplayStart
in your function for cut (after sort and filter) your set of data from iDisplayStart
to iDisplayStart+iDisplayLength
.
You should of course change your code structure as you can see in datatables documentation - define datatables initialization code and indicate ajax source in sAjaxSource
property.
Post a Comment for "Ajax Request For Server Side Data For Each Page In Datatables"