table.row(id).data(); return undefined
table.row(id).data(); return undefined

In each of my rows, I have an ID like this:
<tr id="row-1">...</tr>
When I try to search for this data with:
table.row('row-'+id).data() //id = 1
I get the result in the console: undefined
And when I search the table:
table.rows().nodes()
to see if I have rows, I get this:
{0: tr#row-1,context: ...}
Which means it exists, but the table.row('#row-'+id).data() function doesn't find it.
Answers
Should work. The first version you posted doesn't have the
#
and won't work. I placed your code snippets into this test case to show it works:https://live.datatables.net/dazeluze/1/edit
Possibly
id
is not what you think it is. Start by verifying that.What specifically is undefined? Maybe post the full error.
If you still need help then please provide a link to a test case showing the issue so we can help debug.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin