add select all handler to grid (#2496)

This commit is contained in:
Anthony Dresser
2018-09-10 21:18:39 -07:00
committed by Karl Burtram
parent b06ddf2dc7
commit 4ea13bdbc0
2 changed files with 5 additions and 0 deletions

View File

@@ -7,6 +7,7 @@
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
import { range } from 'vs/base/common/arrays';
/**
* Implements the various additional navigation keybindings we want out of slickgrid
@@ -50,6 +51,8 @@ export class AdditionalKeyBindings<T> implements Slick.Plugin<T> {
}
} else if (event.equals(KeyCode.End | KeyMod.CtrlCmd)) {
this.grid.setActiveCell(this.grid.getDataLength() - 1, this.grid.getColumns().length - 1);
} else if (event.equals(KeyCode.KEY_A | KeyMod.CtrlCmd)) {
this.grid.setSelectedRows(range(this.grid.getDataLength()));
} else {
handled = false;
}