mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-22 07:36:01 +00:00
hide and show columns from keyboard
This commit is contained in:
@@ -125,6 +125,15 @@
|
||||
getSubCommands: () => getCurrentDataGrid().buildFindMenu(),
|
||||
});
|
||||
|
||||
registerCommand({
|
||||
id: 'dataGrid.hideColumn',
|
||||
category: 'Data grid',
|
||||
name: 'Hide colunn',
|
||||
keyText: 'Ctrl+H',
|
||||
testEnabled: () => getCurrentDataGrid() != null,
|
||||
onClick: () => getCurrentDataGrid().hideColumn(),
|
||||
});
|
||||
|
||||
registerCommand({
|
||||
id: 'dataGrid.clearFilter',
|
||||
category: 'Data grid',
|
||||
@@ -433,6 +442,8 @@
|
||||
res.push({
|
||||
text: column.columnName,
|
||||
onClick: async () => {
|
||||
display.setColumnVisibility(column.uniquePath, true);
|
||||
await tick();
|
||||
const invMap = _.invert(realColumnUniqueNames);
|
||||
const colIndex = invMap[column.uniqueName];
|
||||
scrollIntoView([null, colIndex]);
|
||||
@@ -445,6 +456,15 @@
|
||||
return res;
|
||||
}
|
||||
|
||||
export function hideColumn() {
|
||||
const columnIndexes = _.uniq(selectedCells.map(x => x[1]));
|
||||
for (const index of columnIndexes) {
|
||||
console.log('visibleRealColumns[index].uniquePath', visibleRealColumns[index].uniquePath);
|
||||
display.setColumnVisibility(visibleRealColumns[index].uniquePath, false);
|
||||
}
|
||||
// selectedCells = [currentCell];
|
||||
}
|
||||
|
||||
$: autofillMarkerCell =
|
||||
selectedCells && selectedCells.length > 0 && _.uniq(selectedCells.map(x => x[0])).length == 1
|
||||
? [_.max(selectedCells.map(x => x[0])), _.max(selectedCells.map(x => x[1]))]
|
||||
|
||||
Reference in New Issue
Block a user