From 537869e862e287ccff1b452f626c34814d0cd5a5 Mon Sep 17 00:00:00 2001 From: "SPRINX0\\prochazka" Date: Tue, 17 Dec 2024 16:03:21 +0100 Subject: [PATCH] data grid - no rows info --- packages/web/src/datagrid/DataGridCore.svelte | 36 +++++++++++++++++-- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/packages/web/src/datagrid/DataGridCore.svelte b/packages/web/src/datagrid/DataGridCore.svelte index 787708194..66eb34fd2 100644 --- a/packages/web/src/datagrid/DataGridCore.svelte +++ b/packages/web/src/datagrid/DataGridCore.svelte @@ -483,6 +483,7 @@ let domFocusField; let domHorizontalScroll; let domVerticalScroll; + let domContainer; let currentCell = topLeftCell; let selectedCells = [topLeftCell]; @@ -492,7 +493,7 @@ let autofillSelectedCells = emptyCellArray; const domFilterControlsRef = createRef({}); - let isGridFocused=false; + let isGridFocused = false; const tabid = getContext('tabid'); @@ -596,6 +597,7 @@ selectedCells = [cell]; await tick(); scrollIntoView(cell); + domFocusField?.focus(); } export async function cloneRows() { @@ -1838,11 +1840,11 @@ {/if} {:else if isDynamicStructure && isLoadedAll && grider?.rowCount == 0} -
+
{#if display.filterCount > 0} @@ -1867,9 +1869,15 @@ class:data-grid-focused={isGridFocused} bind:clientWidth={containerWidth} bind:clientHeight={containerHeight} + bind:this={domContainer} use:contextMenu={buildMenu} use:contextMenuActivator={activator} on:wheel={handleGridWheel} + on:click={e => { + if (e.target == domContainer) { + domFocusField?.focus(); + } + }} > + + {#if !isDynamicStructure && isLoadedAll && grider?.rowCount == 0} +
+
+ +
+ {#if display.filterCount > 0} + display.clearFilters()} /> + {/if} + {#if grider.editable} + + {/if} + {#if onOpenQuery} + + {/if} +
+ {/if} +