How to use Pagination
How to use Pagination
The examples in the documentation are really vague on Pagination.
1.) Do we need to attach event handlers for the Pagination buttons? if so, where is this defined?
2.) Where does Pagination get or set the limits or limit_offset needed? in general, where does it set its params?
3.) When getting data from an AjaxSource that is NOT Datatable friendly(and needs to be parsed), where do I set the limits, current page, total number of records, etc?
1.) Do we need to attach event handlers for the Pagination buttons? if so, where is this defined?
2.) Where does Pagination get or set the limits or limit_offset needed? in general, where does it set its params?
3.) When getting data from an AjaxSource that is NOT Datatable friendly(and needs to be parsed), where do I set the limits, current page, total number of records, etc?
This discussion has been closed.
Replies
2) iDisplayStart and iDisplayLength are set by the pagination code and by the drop-down length list, respectively. for server side data calls, the params are part of the aoData set sent to the $.ajax() routine and turned into querystring or post data. you can examine or alter these in fnServerData
3) for ajax source (non server side processing) you bring in the entire data set, no limits. pagination will automatically divide into pages. you can set iDisplayStart or use API functions to change pages programmatically. http://datatables.net/api#fnPageChange
http://www.datatables.net/usage/server-side
Although I have already set the the correct values for the response(iTotalRecords,iTotalDisplayRecords,aaData), the pagination at the bottom is still not showing the proper number of pages.