Posted 23 August 2024, 4:42 am EST
Hi,
Overriding onRowEditEnded or onRowEditStarted is not recommended, as these functions are used internally and defined to perform tasks, overriding these functions would stop those internal tasks, which might interrupt the default functioning of the grid. Therefore, it is recommended to use event handlers as much as possible, you can use the ‘rowEditStarted’ and ‘rowEditEnded’ events of the Flexgrid in the current scenario.
Also, please avoid canceling the event as it will cancel the addition of new rows.
// Use rowEditStarted to reset editing properties
this.flex.rowEditStarted.addHandler((s,e) => {
//Skip saving if pasting
if (this.flex.pastingInProgress) {
return;
}
this.flex.onRowEditStartedWrapper(e, () => this.onRowEditStarted(e));
});
// Use rowEditEnded to perform row validation
this.flex.rowEditEnded.addHandler(async(s,e) => {
//Skip saving if pasting
if (this.flex.pastingInProgress) {
return;
}
await this.flex.onRowEditEndedWrapperAsync(e, async () => await this.onRowEditEnded(e));
});
Please find attached an updated sample for the same. In case we missed something, or you need further assistance, do let us know.
Thanks, and regards
flex-demo-patch-97850.zip