How to set the attribute 'id' on a new row?
How to set the attribute 'id' on a new row?

When using the option 'rowId', all 'tr' elements get an attribute 'id'. I use this to be able to retrieve data from the database when one clicks the row.
But when I add a new row, the id is not there. When using
$(newrow).attr('id', id)
nothing happens. This means that clicking the row has no effect. How do I get the row to have an 'id' attribute?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Ok, right after posting I got an idea. And solved my problem.
It appears you jest have to add 'id' to the dataset of table.row.add(). Can't find this in the documentation....
You can use
createdRow
orrow().node()
to manipulate the row and add the ID.If you have the
rowId
option set toid
then yes, that would work. (Edit - corrected option name)Allan