fnUpdate problems
fnUpdate problems
Bender67
Posts: 2Questions: 0Answers: 0
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?
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?
This discussion has been closed.
Replies
Allan
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.