I have a simple datatable instance:
var table = $("#table-elem").DataTable({
...
"ajax": {
"url":Services.apiUrl,
"dataSrc": "data"
},
...
})
I need to access the "data" that was returned in ajax call. How can I do that? Expecting something like:
var ajaxJson = table.ajax.data()
//play with ajaxJson
table.on('xhr', function() {
var ajaxJson = table.ajax.json();
alert(ajaxJson.data.length + ' row(s) were loaded');
});
Gives back the last loaded data, as per the documentation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With