mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-05-02 03:13:58 +00:00
show selected columns in column manager
This commit is contained in:
@@ -82,6 +82,11 @@
|
|||||||
function copyToClipboard() {
|
function copyToClipboard() {
|
||||||
copyTextToClipboard(selectedColumns.join('\r\n'));
|
copyTextToClipboard(selectedColumns.join('\r\n'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function setSelectedColumns(value) {
|
||||||
|
selectedColumns = value;
|
||||||
|
if (value.length > 0) currentColumnUniqueName = value[0];
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<SearchBoxWrapper>
|
<SearchBoxWrapper>
|
||||||
|
|||||||
@@ -93,6 +93,7 @@
|
|||||||
export const activator = createActivator('DataGrid', false);
|
export const activator = createActivator('DataGrid', false);
|
||||||
|
|
||||||
let selectedCellsPublished = () => [];
|
let selectedCellsPublished = () => [];
|
||||||
|
let domColumnManager;
|
||||||
|
|
||||||
const selectedMacro = writable(null);
|
const selectedMacro = writable(null);
|
||||||
setContext('selectedMacro', selectedMacro);
|
setContext('selectedMacro', selectedMacro);
|
||||||
@@ -169,7 +170,7 @@
|
|||||||
height="45%"
|
height="45%"
|
||||||
show={(!freeTableColumn || isDynamicStructure) && !isFormView}
|
show={(!freeTableColumn || isDynamicStructure) && !isFormView}
|
||||||
>
|
>
|
||||||
<ColumnManager {...$$props} {managerSize} {isJsonView} {isDynamicStructure} />
|
<ColumnManager {...$$props} {managerSize} {isJsonView} {isDynamicStructure} bind:this={domColumnManager} />
|
||||||
</WidgetColumnBarItem>
|
</WidgetColumnBarItem>
|
||||||
|
|
||||||
<WidgetColumnBarItem
|
<WidgetColumnBarItem
|
||||||
@@ -226,6 +227,9 @@
|
|||||||
macroPreview={$selectedMacro}
|
macroPreview={$selectedMacro}
|
||||||
bind:loadedRows
|
bind:loadedRows
|
||||||
bind:selectedCellsPublished
|
bind:selectedCellsPublished
|
||||||
|
onChangeSelectedColumns={cols => {
|
||||||
|
if (domColumnManager) domColumnManager.setSelectedColumns(cols);
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
</svelte:fragment>
|
</svelte:fragment>
|
||||||
|
|||||||
@@ -296,6 +296,7 @@ import { apiCall } from '../utility/api';
|
|||||||
export let allRowCount = undefined;
|
export let allRowCount = undefined;
|
||||||
export let onReferenceSourceChanged = undefined;
|
export let onReferenceSourceChanged = undefined;
|
||||||
export let onReferenceClick = undefined;
|
export let onReferenceClick = undefined;
|
||||||
|
export let onChangeSelectedColumns = undefined;
|
||||||
// export let onSelectedCellsPublishedChanged = undefined;
|
// export let onSelectedCellsPublishedChanged = undefined;
|
||||||
export let focusOnVisible = false;
|
export let focusOnVisible = false;
|
||||||
export let formViewAvailable = false;
|
export let formViewAvailable = false;
|
||||||
@@ -787,6 +788,8 @@ import { apiCall } from '../utility/api';
|
|||||||
const cellsValue = () => getCellsPublished(selectedCells);
|
const cellsValue = () => getCellsPublished(selectedCells);
|
||||||
selectedCellsPublished = cellsValue;
|
selectedCellsPublished = cellsValue;
|
||||||
$selectedCellsCallback = cellsValue;
|
$selectedCellsCallback = cellsValue;
|
||||||
|
|
||||||
|
if (onChangeSelectedColumns) onChangeSelectedColumns(getSelectedColumns().map(x => x.columnName));
|
||||||
// if (onSelectedCellsPublishedChanged) onSelectedCellsPublishedChanged(getCellsPublished(selectedCells));
|
// if (onSelectedCellsPublishedChanged) onSelectedCellsPublishedChanged(getCellsPublished(selectedCells));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user