Paging and sorting with custom server API

Paging and sorting with custom server API

ars_enars_en Posts: 1Questions: 1Answers: 0

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

  • felixgillfelixgill Posts: 24Questions: 7Answers: 0

    paging data is in what is sent to the server -- examine packet sent and you will see it.

  • allanallan Posts: 61,771Questions: 1Answers: 10,112 Site admin

    Also it is documented.

    If you want to override the DataTables parameters, you need to use ajax.data to transform them as needed.

    Allan

This discussion has been closed.