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();
});