Adding option to sort columns using F3 key in SlickGrid. (#20897)

This commit is contained in:
Aasim Khan
2022-10-25 08:22:31 -07:00
committed by GitHub
parent ab958a2724
commit 4d5e9adbc1
8 changed files with 26 additions and 12 deletions

View File

@@ -335,6 +335,15 @@ export class TopOperationsTabView extends Disposable implements IPanelView {
}
}));
this._register(table.onKeyDown(e => {
if (e.event.key === 'F3') {
table.grid.sortColumnByActiveCell();
e.event.preventDefault();
e.event.stopPropagation();
}
}));
this._register(table.onContextMenu(e => {
let csvString = '';
let csvStringWithHeader = '';

View File

@@ -945,6 +945,11 @@ declare namespace Slick {
**/
public getSortColumns(): { columnId: string; sortAsc: boolean }[];
/**
* sorts the table by the active cell column values.
*/
public sortColumnByActiveCell(): void;
/**
* Updates an existing column definition and a corresponding header DOM element with the new title and tooltip.
* @param columnId Column id.