Locate a row (for update) by key value

Locate a row (for update) by key value

rpmatthewrpmatthew Posts: 13Questions: 0Answers: 0
edited January 2012 in General
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.

Replies

  • rpmatthewrpmatthew Posts: 13Questions: 0Answers: 0
    edited January 2012
    which I guess brings up a more basic question... when I add or update data I need to add an id and add/remove classes to formatting ..

    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]
  • rpmatthewrpmatthew Posts: 13Questions: 0Answers: 0
    OK - I've found something useful - (always happens after I try to formulate the question) -
    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
This discussion has been closed.