Fixed singleton event problem with multiple cells

pull/104/head
cagataycivici 2019-11-01 10:43:54 +03:00
parent 3fcc3cf58d
commit 7f71bfc47f
1 changed files with 14 additions and 3 deletions

View File

@ -140,10 +140,21 @@ export default {
} }
}, },
completeEdit(event, type) { completeEdit(event, type) {
let editEvent = {originalEvent: event, data: this.rowData, field: this.column.field, index: this.index, type: type, preventDefault: () => event.preventDefault()}; let completeEvent = {
this.$emit('cell-edit-complete', editEvent); originalEvent: event,
data: this.rowData,
field: this.column.field,
index: this.index,
type: type,
defaultPrevented: false,
preventDefault: function() {
this.defaultPrevented = true;
}
};
this.$emit('cell-edit-complete', completeEvent);
if (!event.defaultPrevented) { if (!completeEvent.defaultPrevented) {
this.switchCellToViewMode(); this.switchCellToViewMode();
} }
}, },