alert() in rowCallback
alert() in rowCallback
antoniocib
Posts: 277Questions: 62Answers: 1
Hi guys,
I need a simple little help where I am stuck and I can't figure out how to do it.
I would like to put an alert that displays the counter that is in the rowCallback, I tried in this way only that the alert comes out for every time the counter is updated
var count=0;
rowCallback: function ( row, data, ) {
var d = data.data_scadenza;
$('input.check_p', row).prop( 'checked', data.check_p == 1 );
if ( new Date(d.substr(6,4) + d.substr(2,4) + d.substr(0,2)) < today )
{
count++;
$(row).addClass('myHighlight1')
$(row).removeClass('myHighlight')
}
alert("Ci sono "+count+" fatture scadute" );
},
This question has an accepted answers - jump to answer
Answers
Yes, the alert will show for each row that
rowCallback
processes. I'm guessing you want to show the alert once after Datatables initialization. In this case useinitComplete
to display the alert.Kevin
Solved in this way thanks @kthorngren is very easy to do!