Transforming metadata for server-side pagination

Transforming metadata for server-side pagination

mtkmtk Posts: 1Questions: 1Answers: 0

Hi,

I wonder if there are any hooks after the ajax call successfully received data which can help to manipulate metadata on response.

I explain with an example:

Laravel pagination (for instance) uses different property names on response to indicate the current page, total items, and per-page items than DataTables.

There is a way to make sending the right parameters to Laravel using the data property of ajax in DataTables, but I couldn't find any such hook for the returning response. Something like the below dataflow:

XHR -> jQuery ajax -> "Custom Transformation" -> DataTables

Answers

  • kthorngrenkthorngren Posts: 21,170Questions: 26Answers: 4,922

    Sounds like you want to use the xhr event to manipulate the response before Datatables processes it.

    Kevin

This discussion has been closed.