fnUpdate problems

fnUpdate problems

Bender67Bender67 Posts: 2Questions: 0Answers: 0
edited February 2014 in DataTables 1.9
I have about 20 datatables on a page. Each table has about 5-10 rows.

Updating a single cell causes problems. The interesting part is that I can
upate every first row of any table (and also the second row, but just in the first table).
All tables have the same structure.
Here is the code:

[code] $("#sort_Table" + $("#<%=hidTableId.ClientID %>").val()).dataTable().fnUpdate(data.d, $("#<%=hidRowId.ClientID %>").val(), 10); [/code]

I also tried the following to update the first row but does not work:
[code]
var table = $("#sort_Table" + $("#<%=hidTableId.ClientID %>").val()).dataTable().
table.fnSettings().aoData[0]._aData.Comment = "test";
table.fnDraw();
[/code]

But this works:
[code]
alert(table.fnSettings().aoData[0]._aData.Comment);
[/code]

Any ideas?

Replies

  • allanallan Posts: 63,489Questions: 1Answers: 10,470 Site admin
    Can you link to a page showing the problem please?

    Allan
  • Bender67Bender67 Posts: 2Questions: 0Answers: 0
    Allen,
    Got it to work. The row id was actually a string. So I parsed it into an integer. So instead of:

    [code] $("#sort_Table" + $("#<%=hidTableId.ClientID %>").val()).dataTable().fnUpdate(data.d, $("#<%=hidRowId.ClientID %>").val(), 10); [/code]

    I use now:

    [code] $("#sort_Table" + $("#<%=hidTableId.ClientID %>").val()).dataTable().fnUpdate(data.d, parseInt($("#<%=hidRowId.ClientID %>").val()), 10); [/code]

    Not really sure why it always worked in the first row before.
This discussion has been closed.