How can I get the current datarow or row Id of the actively updating row from an event of the editor provider for the cell
features: [{ name: "Updating", editMode: "cell", showDoneCancelButtons: false, columnSettings: [ columnKey: "myCol", editorType: "mask", editorOptions: { inputMask: 'aaa', keyup: function (evt, ui) { alert("I want to access the current editing row here!"); } } ]}]
Hello,
Each row element in the grid contain an attribute holding its associated PK value. As each editor is a descendant of the row in the DOM tree the most straightforward way to extract this information is through a call like this:
keyup: function (evt, ui) {
var pk = ui.owner.element.closest("tr").attr("data-id");
}
This will return it as a string that you should pass through parseInt in the case of a numeric PK or replace attr("data-id") with data("id").
If the result is undefined you will know that the end-user is trying to add a new row instead of editing one.
I hope this helps! Please, let me know if you have any other questions or concerns!
Thank you for using Infragistics forums!
Best regards,
Stamen Stoychev