footerCallback get data
footerCallback get data
fedein
Posts: 22Questions: 7Answers: 1
Hello everyone!!
I need get a data into a footerCallback. How can i get it?
Is for something like this:
"footerCallback": function ( row, data, start, end, display ) {
var api = this.api(), data;
// Remove the formatting to get integer data for summation
var intVal = function ( i ) {
return typeof i === 'string' ? i.replace(/[\$,]/g, '')*1 : typeof i === 'number' ? i : 0;
};
**if (data['var']==1) **
total = api.column( 8 ).data().reduce( function (a, b) {
return intVal(a) + intVal(b);
},0 );
Thank you very much!!!
This discussion has been closed.
Replies
I guess you are asking about
data['var']
. What isdata['var']
? Please provide details of what you want to do whendata['var']==1
.Kevin
Hi kthorngren, thank you for you answer!
data['var'] is the data of json response.
Sorry for my bad english, regards!!
You can use
ajax.json()
to get the JSON response if you are usingajax
.Kevin
Thank you very much Kevin!!!!