Can't add TR ids efter fnAddData()

Can't add TR ids efter fnAddData()

rasmuslindstromrasmuslindstrom Posts: 7Questions: 0Answers: 0
edited September 2012 in General
Hello!

I need to add new rows via the API and I use: fnAddData()

My problem is now that I need to add an ID to every tr. I use this code, but when I look at the gode via FireBug, I can't see an ID after adding the row. What am I doing wrong?

[code]/* Global var for counter */
var giCount = 1;

$(document).ready(function() {
$('#example').dataTable();
} );

function fnClickAddRow() {
$('#example').dataTable().fnAddData( [
giCount+".1",
giCount+".2",
giCount+".3",
giCount+".3",
giCount+".4" ] );

giCount++;

var theNode = $j('#example').dataTable().fnSettings().aoData[addId[0]].nTr;
theNode.setAttribute('id','alarmNum_'+giCount);

}[/code]
This discussion has been closed.