Skip to content

Commit

Permalink
Fixing grid to always call onDelete on the w2ui event is completed
Browse files Browse the repository at this point in the history
  • Loading branch information
julien-moreau committed Aug 4, 2018
1 parent 74702b2 commit f3f1da0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/editor/gui/grid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,13 @@ export default class Grid<T extends GridRow> {
if (event.force) {
const selected = <number[]>this.element.getSelection();

if (this.onDelete)
this.onDelete(selected);
event.onComplete = () => {
if (this.onDelete)
this.onDelete(selected);

for (let i = 0; i < this.element.records.length; i++)
this.element.records[i]['recid'] = i;
for (let i = 0; i < this.element.records.length; i++)
this.element.records[i]['recid'] = i;
}
}
},

Expand Down

0 comments on commit f3f1da0

Please sign in to comment.