I am using this code to init DataTable:
$('#table-groups').dataTable( {
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"bFilter": false,
"bInfo": false,
"aLengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]],
"aoColumns": [
{ "sClass": "name" },
{ "sClass": "tools", "bSortable": false},
],
});
Now I am adding rows via server-side script like this:
$('#table-groups').dataTable().fnAddData( ["<strong>"+$_returnvalue.name+"</strong>","<div class=\"cell edit\"> Group ID is: "+$_returnvalue.entryid+" </div>"]);
And my question: is there a way to insert value of $_returnvalue.entryid to be ID of the <tr> ?
You can use the fnCreatedRow callback
You can do something like where
aData[0]has to be the id.Demo: Fiddle