Custom JSON attribute for Total Records?
Custom JSON attribute for Total Records?
jmatt0806
Posts: 2Questions: 1Answers: 0
Have tried finding an answer to this question with no luck:
Is it not possible to map a custom attribute for Total Records?
i.e. If JSON field name is "Total" can it be mapped to "totalRecords"?
This discussion has been closed.
Answers
You can use the
ajax.dataSrc
option as a function to be able to manipulate the JSON object returned from the server before DataTables uses it. That provides the opportunity to map between parameters however you need.Allan
Any example of using "dataSrc" to return Total Records available?
Tried searching, but have yet to find an example.
Not directly, but the last example on that doc page shows how to use it as a function. Then all you would do is something like
json.totalRecords = json.Total;
.Allan