How to use Pagination

How to use Pagination

arvinsimarvinsim Posts: 20Questions: 1Answers: 0
edited September 2011 in General
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?

Replies

  • fbasfbas Posts: 1,094Questions: 4Answers: 0
    1) no. done for you somewhere in the datatables core code. not sure.

    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
  • arvinsimarvinsim Posts: 20Questions: 1Answers: 0
    3) Can you show me where the event handler for the pagination is? is it even customizable? or is it all being done by Datatables?
  • arvinsimarvinsim Posts: 20Questions: 1Answers: 0
    Also I referred to this page for pagination
    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.
This discussion has been closed.