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 cf5ed8140b..2fae9c0213 100644 --- a/packages/client/manifest.json +++ b/packages/client/manifest.json @@ -7017,10 +7017,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 e365429cb6..4ed8f91f2a 100644 --- a/packages/client/src/components/app/GridBlock.svelte +++ b/packages/client/src/components/app/GridBlock.svelte @@ -1,8 +1,8 @@