Can't add TR ids efter fnAddData()
Can't add TR ids efter fnAddData()
![rasmuslindstrom](https://secure.gravatar.com/avatar/e102ee2518802cca02c4ea325dda94a3/?default=https%3A%2F%2Fvanillicon.com%2Fe102ee2518802cca02c4ea325dda94a3_200.png&rating=g&size=120)
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]
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.