Pagination

Pagination

icey502icey502 Posts: 1Questions: 0Answers: 0
edited May 2012 in DataTables 1.9
Hi there,

I have a Java spring-based back end and I am trying to rig up a datatables 1.9.x front using one of the alternative pagination approaches.

I have an initial version without any paging, in which the back end is returning JSON and I am stuffing the JSON manually into an aaData object on the browser side. After looking through the examples and source, I am still wondering how to go about creating the pagination hooks in a rest-ful way (e.g. "http://myserver/page/1/pagesize/50" meaning page 1 with a page size of 50 records). Is there a callback somewhere that will provide this hook, and how do I grab the existing parameters of the datatable to do it? If this seems too broad of a question, just a pointer in the right direction would be helpful.

Thanks and best regards,
icey502

Replies

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin
    Are you wanting to do server-side processing (where is draw - i.e. filtering, paging, sorting - makes a request to the server)? If so, the way to use REST with server-side processing for this is to use fnServerData and alter the request URL based on the parameters that DataTables is requesting (in the data array given to the function).

    Allan
This discussion has been closed.