Dynamically add ID's to each row
Dynamically add ID's to each row
I read here: http://datatables.net/release-datatables/examples/server_side/ids.html
Unfortunately, I am adding data to the table dynamically like this:
[code]
$('#friends_lost').dataTable().fnAddData([
textout.name,
beg + 'true, ' + textout.id + end,
'Not lost'
]);
[/code]
How would I go about to add an ID or class to this datarow that I'm feeding into the table?
Kind regards,
Tanax
Unfortunately, I am adding data to the table dynamically like this:
[code]
$('#friends_lost').dataTable().fnAddData([
textout.name,
beg + 'true, ' + textout.id + end,
'Not lost'
]);
[/code]
How would I go about to add an ID or class to this datarow that I'm feeding into the table?
Kind regards,
Tanax
This discussion has been closed.
Replies
[code]
$('#friends_lost').dataTable().fnAddData( {
"DT_RowId": "myId",
"0": textout.name,
"1": beg + 'true, ' + textout.id + end,
"2": 'Not lost'
} );
[/code]
Allan