Cannot set property id of null
Cannot set property id of null
elahi1mahdi
Posts: 9Questions: 5Answers: 0
I set Id In add Row But Show This Error 'Cannot set property id of null'
Why?
var table1 = $('#Mytable').DataTable();
var rowNode = table1.row.add([firstrow, data.customerFullName, model.title, model.data_Contract, model.data_Delivery, model, data.project_status, lastrow])
.node().id = 'MyID';
table1.draw(false);
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Hi @elahi1mahdi ,
It's probably because the column count doesn't match what's expected. We're happy to take a look, but it would help, as per the forum rules, if you could link to a running test case showing the issue so we can offer some help. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.
Cheers,
Colin
how do i write now? @colin
How to Solve This Problem ? @colin
As Colin noted, please provide a link to a test case showing the issue so we can help to debug the problem.
My guess is that you might have
deferRender
enabled and the node hasn't been created when you callrow().node()
. But without a test case it is impossible to say.Allan