Locate a row (for update) by key value
Locate a row (for update) by key value
I have a DataTable with data already populated from an Ajax return. Each row has a unique value in the data (first column).
On successive calls to get updated json data I need to locate the row in the DataTable by that value so that I can do a fnUpdate...
Any ideas - I know it's simple - just can't find it after several hours and thought I'd ask...
I assume you add an ID to the TR element... but unknown.
On successive calls to get updated json data I need to locate the row in the DataTable by that value so that I can do a fnUpdate...
Any ideas - I know it's simple - just can't find it after several hours and thought I'd ask...
I assume you add an ID to the TR element... but unknown.
This discussion has been closed.
Replies
I am using the following to init..
[code]
oTable = $('#table').dataTable({
"bJQueryUI": true,
"bPaginate": false,
"sScrollY": "100%",
"aoColumns": [
{"mDataProp": "unit","sTitle":"Unit"},
{"mDataProp": "status","sTitle":"Status"},
{"mDataProp": "duration","sTitle":"Duration"},
{"mDataProp": "response","sTitle":"Response"},
{"mDataProp": "destination","sTitle":"Destination"}
],
"sAjaxSource:":"jsontest.php"
});
[/code]
I am using something similar to what follows:
I assume that now I have an ID - then now I can find it to update the row.
[code]
$.getJSON(oSettings.sAjaxSource, null, function(json){
for (var i=0; i