What's the right way to map response values to DT?
What's the right way to map response values to DT?
EndUser
Posts: 5Questions: 2Answers: 0
According to the manual, DT expects the response to have certain values. However, if the server can't be made to change those parameters but does contain the information, how can I map the response to fields that DT is expecting? For example, DT expect to see {recordsTotal: 14}
in the response, but my server wants to send {totalElements:14}
. Is there an way to map that value to the expected parameter?
This discussion has been closed.
Answers
Ok, so it says I can use the
dataSrc
property for a transformation function. Here's an example of what I've tried:(my data containing object is called 'content')
This sets
recordsTotal
correctly. Now, I need to figure out if I can do the same with the current page and total pages.