Skip to content

Commit f3f1da0

Browse files
committed
Fixing grid to always call onDelete on the w2ui event is completed
1 parent 74702b2 commit f3f1da0

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/editor/gui/grid.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,11 +177,13 @@ export default class Grid<T extends GridRow> {
177177
if (event.force) {
178178
const selected = <number[]>this.element.getSelection();
179179

180-
if (this.onDelete)
181-
this.onDelete(selected);
180+
event.onComplete = () => {
181+
if (this.onDelete)
182+
this.onDelete(selected);
182183

183-
for (let i = 0; i < this.element.records.length; i++)
184-
this.element.records[i]['recid'] = i;
184+
for (let i = 0; i < this.element.records.length; i++)
185+
this.element.records[i]['recid'] = i;
186+
}
185187
}
186188
},
187189

0 commit comments

Comments
 (0)