Check which edit mode when calling editor save callback and editor cancel callback

pull/2749/head
Ancient-Dragon 2022-07-01 21:02:08 +01:00
parent 9bea5bb25f
commit 2ad51a7c6e
1 changed files with 11 additions and 2 deletions

View File

@ -330,10 +330,19 @@ export default {
this.$emit('row-edit-init', {originalEvent: event, data: this.rowData, newData: this.editingRowData, field: this.field, index: this.rowIndex});
},
editorSaveCallback(event) {
this.$emit('row-edit-save', {originalEvent: event, data: this.rowData, newData: this.editingRowData, field: this.field, index: this.rowIndex});
if (this.editMode === 'row') {
this.$emit('row-edit-save', {originalEvent: event, data: this.rowData, newData: this.editingRowData, field: this.field, index: this.rowIndex});
} else {
this.completeEdit(event, 'enter');
}
},
editorCancelCallback(event) {
this.$emit('row-edit-cancel', {originalEvent: event, data: this.rowData, newData: this.editingRowData, field: this.field, index: this.rowIndex});
if (this.editMode === 'row') {
this.$emit('row-edit-cancel', {originalEvent: event, data: this.rowData, newData: this.editingRowData, field: this.field, index: this.rowIndex});
} else {
this.switchCellToViewMode();
this.$emit('cell-edit-cancel', {originalEvent: event, data: this.rowData, field: this.field, index: this.rowIndex});
}
},
updateStickyPosition() {
if (this.columnProp('frozen')) {