Clicking outside row editing is committing changes…
New DiscussionI’m on IG12.3 and AG 12.3.
I am asking a follow-up to onrowedit default behaviour, since that didn’t work for me. I assume I’m doing something wrong, as always, though.
Here is my grid declaration:
Scenarios
{{badNameWarning}}
{{cell.value}}
{{cell.value}}
{{value.replace('sys_nsgplanning', 'SYSTEM') | uppercase}}
{{value | date:'MM/dd/yy hh:mm a'}}
{{value.replace('sys_nsgplanning', 'SYSTEM') | uppercase}}
{{value | date:'MM/dd/yy hh:mm a'}}
Here is my code for rowEdit and cellEdit:
@ViewChild('scenarioList', { static: false, read: IgxGridComponent }) public scenarioList: IgxGridComponent;
cellEditStart(e:any) {
if (e.rowData.scenarioType == 'Actual' || (!this.globals.user.isAdmin && e.rowData.locked) || (!this.globals.user.isContributor)) { e.cancel = true; }
const row = e && e.cellID ? this.scenarioList.getRowByIndex(e.cellID.rowIndex) : null;
if (!row || !row.inEditMode) { this.scenarioList.endEdit(false); }
};
async rowEditedDone(e:IGridEditDoneEventArgs) {
this.editingScenario = e.oldValue;
this.updateScenario(e.newValue);
};
The cancel button works fine, but when moving to a cell in a different row while editing, it commits the changes rather than discarding them.
Aside from committing changes users don’t want, it’s also incorrectly reporting the type of a scenario (comparing against the new row selected, rather than the original row being edited).
Sign In
to post a reply
Replies
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Favorites
0 Replies
1 Created On
Feb 16, 2022 Last Post
4 years ago