Trying to update a row with fbUpdate

Trying to update a row with fbUpdate

AzaretAzaret Posts: 17Questions: 2Answers: 0
edited February 2012 in Bug reports
Hi,

I want to update some rows on a datatable, when i try to update a specific cell it works perfectly, but when I try to send a whole object for update the row, it fails and the JS console return errors :

"j is undefined
..."==d||"th"==d)&&f.push(j.nTr.childNodes[e]);d=0;for(e=0,i=a.aoColumns.length;e

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Second parameter - "myId" is that a node? A TR node specifically? It should work! Are you using the latest version of DataTables (1.9.0)?

    Allan
  • AzaretAzaret Posts: 17Questions: 2Answers: 0
    Hi,

    I'm using the last version of DataTables yes.
    Actualy myId is the index of the record on the table from datatable.
    In more details I'm doing like this :

    $("' .datatable").each(function () {
    var aData = $(this).dataTable();
    for (key in data.records) {
    var id = -1;
    var oData = aData.fnGetData();
    for (rec in oData) {
    if (oData[rec].id == data.records[key].id)
    id = rec;
    }
    if (id >= 0) {
    aData.fnUpdate(data.records[key], id);
    }
    }
    });

    Where data.records is the set of records I would to update in my datatable.
    I'm not sure of how to use TR node, I want to update all DataTable records, and not only those shown.
  • maczormaczor Posts: 4Questions: 0Answers: 0
    Hi,
    I HAD similar problem - just solved it.

    For whatever (important) reason I converted the node id to string and had this error.

    parseInt did the job.

    BTW great work allan - would you be so kind and have a look at my other post?
    http://datatables.net/forums/discussion/comment/30340#Comment_30340
  • AzaretAzaret Posts: 17Questions: 2Answers: 0
    ça fonctionne, merci beaucoup maczor.
This discussion has been closed.