Preprocess JSON data just after retrieved from server
Preprocess JSON data just after retrieved from server

How can I preprocess JSON data which is retrieved from datatable ajax call. I want to modify it on client side and pass it to draw - so that it can use modified json.
what i want to achieve is:
Server responds with a response in this format:
data : {
datatTableResult: [{ }, .... { }],
additionalData1: {}
additionalData2: {}
}
I want to pass data.dataTableResult as a source of data for my columns.
Thanks!
This discussion has been closed.
Answers
Use the
ajax.dataSrc
option to modify the JSON before returning it to DataTables.If all you need to do is tell DataTables where the result data is, just use it as a string:
dataSrc: 'data.datatTableResult'
.Allan