Question v0.4.3: how to post process ajax data before feeding to the table
Dear all,
For version v0.4.3 I have the following question:
In the following code, data is retrieved from the url 'url/to/serverside' and is fed directly to the datatable. But what if I want to change that data (enhance or change structure) before feeding to the datatable, then how can I do it ?
.withOption('ajax', { url: 'url/to/serverside', type: 'GET' } .withOption('serverSide', true)
-
One thought: I can build a function using another library to retrieve ajax data. If that function, named getAjaxReturnPromise(), returns a promise then I could use DTOptionsBuilder.fromFnPromise(function(){ return getAjaxReturnPromise().then(function(rawData){ // post process this rawData rawData = postProcess(rawData); return rawData; } })
-
But is there some other way ?
I've followed the link http://codepen.io/l-lin/pen/Gpgxqo?editors=101, and it works Thanks