Datatable : add row and check added row's index

Datatable : add row and check added row's index

eldyeldy Posts: 3Questions: 3Answers: 0

I want to check whether the newly added row appear in first page or not. One way of doing it is get the index, but I wonder why it doesn't work, the index for me is not accurate at all.

function add_row(name, time_taken, attempts) {
var t = $('#dashboard').DataTable();
var node = '';
node = t.row.add([
'',
name,
time_taken,
attempts
]).draw().node();
$(node).attr('id', concatSpaces(name)).hide().fadeIn('slow');

var index = t.row('#' + concatSpaces(name).index() // doesn't work
any thought? stuck for 2 hours long!

This discussion has been closed.