Paging and sorting with custom server API
Paging and sorting with custom server API
Hi All. I have already created server API to get some data. It uses POST method to receive JSON object and handle paging.
Posted JSON object looks like this
{
....
orderField: "FirstName",
startIndex: 40,
fetchCount: 10,
}
Server API returns JSON data like this
``` {
data: [ {FirstName: "AAA", LastName: "BBB"],
totalCount: 500,
currentPage: 1,
} ```
Now i need to integrate returned data with datatable and set paging info using JavaScript API.
Is It possible to post custom paging info to server API and apply returned JSON data to table (including paging info).
Thank you.
Answers
paging data is in what is sent to the server -- examine packet sent and you will see it.
Also it is documented.
If you want to override the DataTables parameters, you need to use
ajax.data
to transform them as needed.Allan