trouble using fnUpdate to update a row

trouble using fnUpdate to update a row

JCFMachadoJCFMachado Posts: 3Questions: 0Answers: 1
edited January 2013 in General
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.

Replies

  • JCFMachadoJCFMachado Posts: 3Questions: 0Answers: 1
    as i eventually found out, fnUpdate doesn't recognize the $("#rowId") object. First i tried to use $("#rowId").index() to get the rowIndex to update, it would work except when the row is 1 then fnUpdate assumes you're updating a complete row and not a cell. Anyway i solved with a simple variation
    [code]$("#tbl").dataTable().fnUpdate(aaData[0], document.getElementById(aaData[0].DT_RowId));[/code]
This discussion has been closed.