Getting row data after edit

Getting row data after edit

csyucsyu Posts: 12Questions: 1Answers: 1
edited July 2022 in Editor

Hello,

Description of the problem
I'm able to edit my table without issue. However, after I edit a cell, I am looking get other cell data from the row where the edit was made. To do so, I wrote the following code without success.

Here is my code:

editor.on('edit', function(e, json, data, id) {
console.log("Row id: " + id);
var row = table.row(id).data();
console.log(row);
var versionNo = $.fn.dataTable.version;
console.log("Datatable version: " + versionNo);
});

Debugger console
Row id: id_1962
undefined
Datatable version: 1.12.1

Any help would be much appreciated.

Thanks

Replies

  • kthorngrenkthorngren Posts: 20,144Questions: 26Answers: 4,736

    I think you will want to use the row-selector as shown in this String - #ID selector example. For example:

    table.row( "#" + id ).data();
    

    Kevin

  • csyucsyu Posts: 12Questions: 1Answers: 1

    Thank you very much Kevin. That worked.

Sign In or Register to comment.