mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-20 09:35:38 -05:00
Selection in grid context (#2527)
* update action context on selection change * correctly add ranges rather than a new range for every row * add required functions to typings
This commit is contained in:
committed by
Karl Burtram
parent
c559ac7be9
commit
89e6d363e2
@@ -52,7 +52,13 @@ 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()));
|
||||
// check if we can set the rows directly on the selectionModel, its cleaner
|
||||
let selectionModel = this.grid.getSelectionModel();
|
||||
if (selectionModel) {
|
||||
selectionModel.setSelectedRanges([new Slick.Range(0, 0, this.grid.getDataLength() - 1, this.grid.getColumns().length - 1)]);
|
||||
} else {
|
||||
this.grid.setSelectedRows(range(this.grid.getDataLength()));
|
||||
}
|
||||
} else {
|
||||
handled = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user