1

I want to use JQuery datatable to display data on an HTML table but the data is coming from an API endpoint that uses pagination. The pagination object contains a detailed description of the pages - next page, number of pages, etc. How do I use this information to alter datatable's default pagination schema? I want the table to show either next or previous depending on information from the pagination object.

Here is the sample pagination object

"page_details": {
  "has_next_page": true,
  "has_previous_page": false,
  "next_page": 2,
  "previous_oage": 0,
  "total": 24
}

Here is my datatable:

$(document).ready(function () {
  $('#myTable').DataTable();
});
3
  • You need server side processing to true. Here is the answer to your question stackoverflow.com/questions/25924546/… Commented Jul 24, 2018 at 11:28
  • Possible duplicate of Server side pagination using datatables Commented Jul 27, 2018 at 8:31
  • Did you manage to find the solution ? I'm almost done but not able to link the next and previous page to my links inside my API. Thank ! Commented Sep 15, 2020 at 7:28

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.