trouble using fnUpdate to update a row
trouble using fnUpdate to update a row
JCFMachado
Posts: 3Questions: 0Answers: 1
Hi,
I'm having trouble updating a row using fnUpdate.
According to the documentation i should be able to use an object with the row data as the 1st parameter and a TR Element as the 2nd parameter . I'm trying to update a row with the following code:
[code]$("#tbl").dataTable().fnUpdate(aaData[0], $("#" + aaData[0].DT_RowId));[/code]
the aaData is an object with the row data to be updated and is identical to the original aaData used to populate the table.
Any thoughts on what i'm doing wrong? Thanks in advance
The error i'm getting with this example is "Cannot set property '_aData' of undefined", which he probably doesn't recognize $("#"+aaData[0].DT_RowId) as a destination, even it represents the correct row in the table.
I'm having trouble updating a row using fnUpdate.
According to the documentation i should be able to use an object with the row data as the 1st parameter and a TR Element as the 2nd parameter . I'm trying to update a row with the following code:
[code]$("#tbl").dataTable().fnUpdate(aaData[0], $("#" + aaData[0].DT_RowId));[/code]
the aaData is an object with the row data to be updated and is identical to the original aaData used to populate the table.
Any thoughts on what i'm doing wrong? Thanks in advance
The error i'm getting with this example is "Cannot set property '_aData' of undefined", which he probably doesn't recognize $("#"+aaData[0].DT_RowId) as a destination, even it represents the correct row in the table.
This discussion has been closed.
Replies
[code]$("#tbl").dataTable().fnUpdate(aaData[0], document.getElementById(aaData[0].DT_RowId));[/code]