Inline editor: Get current row data in setData event

Inline editor: Get current row data in setData event

blcdhqblcdhq Posts: 5Questions: 3Answers: 0

Hi, I would like to use the current row's data from the table inside the Editor's "setData" or "postSubmit" event. How do I get a reference of the currently shown data (just for the row that the editor was used on).
The server's response in my case only contains the edited column data, and I want to fill it up with the data for the other columns.

Answers

  • allanallan Posts: 63,761Questions: 1Answers: 10,510 Site admin

    You can use modifier() to get whatever was used to trigger the edit - a row index or node for example. You could perhaps use:

    var modifier = editor.modifier();
    var data = table.row( modifier ).data();
    

    Note that in postSubmit the data will be the new data for the row. By that time the row has been updated.

    Allan

This discussion has been closed.