counter in rowCallback
counter in rowCallback
antoniocib
Posts: 277Questions: 62Answers: 1
rowCallback: function ( row, data, ) {
var count=[];
var today = new Date;
if ( new Date( data.data_scadenza ) < today){
count++;
}
console.log(count);
},
Hi guys, where i wrong?
This question has an accepted answers - jump to answer
Answers
Okay my bad,
I put the array inside the rowCallback and it was always reset
a counter should be an integer variable not an array.
In addition since rowCallback is called for every row you would need a global variable if you want to count the number of rows meeting a condition.