Get rowid from row object
Get rowid from row object
Tronik
Posts: 122Questions: 28Answers: 1
Hi,
How can I get the row id when iterating through row objects as:
var data = table.rows( { selected: true } ).data();
$.each( data, function (id, value) {
console.log(id); //Prints 0,1,2 etc instead of the rowId I need
console.log(value); //Prints object
} );
This discussion has been closed.
Answers
Hi @Tronik ,
Yep, that will just print the index into the data array, not anything to do with the contents of the array.
The best bet would be to use
rows().ids()
.Cheers,
Colin