Getting row data after edit

Getting row data after edit

csyucsyu Posts: 6Questions: 0Answers: 0
edited July 26 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: 16,790Questions: 25Answers: 3,979

    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: 6Questions: 0Answers: 0

    Thank you very much Kevin. That worked.

Sign In or Register to comment.