count seconds into cell x

count seconds into cell x

xan267xan267 Posts: 1Questions: 0Answers: 0
edited November 2013 in DataTables 1.9
Hello, congratulations for this api!

but let's get to it: it is possible to create a second counter inside a cell of dataTable?

Below is an example of my code:


"fnDrawCallback": function () {


var start = 0;
function count() {
start++;
if (start)
setTimeout(count, 1000);
}




$('#example tr:eq(1)').each(function (){
// for each row:
var sec = $(this).children('td:eq(4)').text();
var t = count();


var aux = sec.split(":");
h = parseInt(parseInt(aux[0]));
m = parseInt(parseInt(aux[1]));
s = parseInt(parseInt(aux[2]) + t);
result = (h + ":" + m + ":" + s);

var up = $(this).children('td:eq(4)').html(result);





});


}


Thanks!.
This discussion has been closed.