Reputation: 21
I am trying to use datatable plugin for ajax pagination. It loads the first set of data but the pagination doesn't work. Can someone Please give me a good example of datatable ajax pagination?
I need to know how to set the number of rows to display as well.
Upvotes: 1
Views: 3093
Reputation: 23978
You need to create an AJAX end point (database will populate table from here).
Following JSON data is expected from datatables.
iTotalRecords – Number of total records in the table, before applying the filters.
iTotalDisplayRecords – Number of records returned after applying the filters.
sEcho – An un-altered copy of the sEcho sent from the client.
aaData – Array of data from the server.
Please read it here: http://www.sitepoint.com/working-jquery-datatables/
Upvotes: 1