diff --git a/packages/builder/src/components/design/settings/controls/ButtonActionEditor/actions/ExportData.svelte b/packages/builder/src/components/design/settings/controls/ButtonActionEditor/actions/ExportData.svelte index 096341783d..a857bc7ede 100644 --- a/packages/builder/src/components/design/settings/controls/ButtonActionEditor/actions/ExportData.svelte +++ b/packages/builder/src/components/design/settings/controls/ButtonActionEditor/actions/ExportData.svelte @@ -49,17 +49,20 @@ }, ] - $: tables = findAllMatchingComponents($selectedScreen?.props, component => - component._component.endsWith("table") - ) - $: tableBlocks = findAllMatchingComponents( + $: components = findAllMatchingComponents( $selectedScreen?.props, - component => component._component.endsWith("tableblock") + component => { + const type = component._component + return ( + type.endsWith("/table") || + type.endsWith("/tableblock") || + type.endsWith("/gridblock") + ) + } ) - $: components = tables.concat(tableBlocks) $: componentOptions = components.map(table => ({ label: table._instanceName, - value: table._component.includes("tableblock") + value: table._component.endsWith("/tableblock") ? `${table._id}-table` : table._id, })) @@ -69,6 +72,7 @@ $: selectedTable = components.find( component => component._id === selectedTableId ) + $: parameters.rows = `{{ literal [${parameters.tableComponentId}].[selectedRows] }}` onMount(() => { if (!parameters.type) { diff --git a/packages/client/manifest.json b/packages/client/manifest.json index 006e04a9f9..392028aa33 100644 --- a/packages/client/manifest.json +++ b/packages/client/manifest.json @@ -7066,10 +7066,22 @@ ] } ], - "context": { - "type": "schema", - "scope": "local" - }, + "context": [ + { + "type": "schema", + "scope": "local" + }, + { + "type": "static", + "values": [ + { + "label": "Selected rows", + "key": "selectedRows", + "type": "array" + } + ] + } + ], "actions": ["RefreshDatasource"] }, "bbreferencefield": { diff --git a/packages/client/src/components/app/GridBlock.svelte b/packages/client/src/components/app/GridBlock.svelte index 8236d77c25..7da2c032e2 100644 --- a/packages/client/src/components/app/GridBlock.svelte +++ b/packages/client/src/components/app/GridBlock.svelte @@ -1,8 +1,8 @@