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