From f7d7746327411da06cede4e0ff06222d318d01bc Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Thu, 7 Dec 2023 18:16:17 +0100 Subject: [PATCH] fix: fix extraOptions for agGrid --- .../display/table/AppAggridTable.svelte | 63 +++---------------- 1 file changed, 10 insertions(+), 53 deletions(-) diff --git a/frontend/src/lib/components/apps/components/display/table/AppAggridTable.svelte b/frontend/src/lib/components/apps/components/display/table/AppAggridTable.svelte index 5cec39ed30..e5a566956a 100644 --- a/frontend/src/lib/components/apps/components/display/table/AppAggridTable.svelte +++ b/frontend/src/lib/components/apps/components/display/table/AppAggridTable.svelte @@ -126,10 +126,6 @@ } let extraConfig = resolvedConfig.extraConfig - $: if (!deepEqual(extraConfig, resolvedConfig.extraConfig)) { - extraConfig = resolvedConfig.extraConfig - api?.updateGridOptions({ ...extraConfig }) - } let api: GridApi | undefined = undefined @@ -159,6 +155,7 @@ outputs?.page.set(event.api.paginationGetCurrentPage()) }, suppressRowDeselection: true, + ...(resolvedConfig?.extraConfig ?? {}), onGridReady: (e) => { outputs?.ready.set(true) value = value @@ -197,6 +194,13 @@ $: value && updateValue() + $: if (!deepEqual(extraConfig, resolvedConfig.extraConfig)) { + extraConfig = resolvedConfig.extraConfig + if (extraConfig) { + api?.updateGridOptions(extraConfig) + } + } + function updateValue() { api?.updateGridOptions({ rowData: value }) } @@ -214,7 +218,8 @@ rowSelection: resolvedConfig?.multipleSelectable ? 'multiple' : 'single', rowMultiSelectWithClick: resolvedConfig?.multipleSelectable ? resolvedConfig.rowMultiselectWithClick - : undefined + : undefined, + ...(resolvedConfig?.extraConfig ?? {}) }) } @@ -263,54 +268,6 @@ {#key resolvedConfig?.pagination} {#if loaded}
- {:else} {/if}