Add more functionality to the grid (#7516)

This commit is contained in:
Amir Omidi
2019-10-05 12:08:18 -07:00
committed by GitHub
parent 0b2a2ad0ed
commit cacbcb5415
2 changed files with 18 additions and 9 deletions

View File

@@ -114,7 +114,7 @@ export class CellSelectionModel<T> implements Slick.SelectionModel<T, Array<Slic
let columnIndex = this.grid.getColumnIndex(args.column.id!);
if (this.grid.canCellBeSelected(0, columnIndex)) {
let ranges: Array<Slick.Range>;
if (e.shiftKey) {
if (e.ctrlKey) {
ranges = this.getSelectedRanges();
ranges.push(new Slick.Range(0, columnIndex, this.grid.getDataLength() - 1, columnIndex));
} else {
@@ -230,9 +230,17 @@ export class CellSelectionModel<T> implements Slick.SelectionModel<T, Array<Slic
let ranges: Array<Slick.Range>;
ranges = this.getSelectedRanges();
ranges = this.insertIntoSelections(ranges, new Slick.Range(args.row, args.cell));
this.grid.setActiveCell(args.row, args.cell);
let selectedRange: Slick.Range;
if (args.cell === 0) {
selectedRange = new Slick.Range(args.row, 1, args.row, args.grid.getColumns().length - 1);
} else {
selectedRange = new Slick.Range(args.row, args.cell);
}
ranges = this.insertIntoSelections(ranges, selectedRange);
this.grid.setActiveCell(selectedRange.toRow, selectedRange.toCell);
this.setSelectedRanges(ranges);
e.preventDefault();