Posted 16 June 2020, 8:29 am EST
I am trying to cancel the editing in certain circumstances,
When I have args.oldItem.levelNum === 1 I invoke the cancel editing. It comes back the with the status of cancel editing and then opens my custom text area editor. I used the same code you used for the text area editor
onEditingDataView(sender: any, args: any): void {
if ((args.status === 'endEditing' && args.isNewRow) || args.status === 'cancelEditing') {
this.dataView.invalidate();
return;
}
if (args !== undefined) {
if (args.oldItem.levelNum === 1) {
if (args.status === 'beforeStartEditing') {
this.dataView.cancelEditing();
return;
}
}
if (args.status === 'beforeEndEditing') {
if (
args.oldItem.notes !== args.newItem.notes &&
args.newItem.notes !== '' &&
args.oldItem != null
) {
const reportKeys = {
entityid: args.newItem.col3,
booktaxdifferenceID: args.newItem.col6,
};
const notes: any = {
ReportId: args.newItem.reportid,
Notes: args.newItem.notes,
ReportKeys: reportKeys,
ReportName: 'TaxAdjBookBasisDiffBetweenBoyEoy',
};
this.SaveData(notes);
}
}
}
}