Hi Cyril,
Thanks for contacting Syncfusion support.
From your update, we understood that you want to perform actions while
clicking the “clear” button based on the Grid edit mode. If yes, you can find whether
the current row is an editable row or not by searching for the rows containing the
“e-addedrow” or “e-editedrow” class. If it is in edit mode, you can clear the
values in the current row editors by setting the default values just like you
did for the “ItemCode” select action. If it is in view mode, you can delete the
row by using the “deleteRecord” method. Please refer to the below code example and
API link for more information.
|
commandClick: function (args) {
. . .
if (args.commandColumn && args.commandColumn.type === "Clear") {
if (args.target.closest(".e-addedrow") || args.target.closest(".e-editedrow")) {
// Clear Row data if row is in Edit mode
let ItemDescription =
gridInst.editModule.formObj.element.querySelector(
"#" + "ItemDescription"
);
ItemDescription.value = "";
// Need to set the
empty string null or required values for all editors just as the above
. . .
} else {
// Delete Row if row is in View mode
this.$refs.SO_lineItem_Grid.ej2Instances.deleteRecord("ItemCode", args.rowData["ItemCode"]);
}
}
},
|
API: https://ej2.syncfusion.com/vue/documentation/api/grid/#deleterecord
Please get back to us if you need further assistance on this.
Regards,
Pavithra S