diff --git a/packages/client/src/components/app/GridBlock.svelte b/packages/client/src/components/app/GridBlock.svelte index 7e69fcdcea..6fe436c0e2 100644 --- a/packages/client/src/components/app/GridBlock.svelte +++ b/packages/client/src/components/app/GridBlock.svelte @@ -5,9 +5,10 @@ import { Grid } from "@budibase/frontend-core" export let table - export let allowAddRows - export let allowEditRows - export let allowDeleteRows + export let allowAddRows = true + export let allowEditRows = true + export let allowDeleteRows = true + export let stripeRows = false const component = getContext("component") const { styleable, API, builderStore } = getContext("sdk") @@ -23,6 +24,7 @@ {allowAddRows} {allowEditRows} {allowDeleteRows} + {stripeRows} showControls={false} allowExpandRows={false} allowSchemaChanges={false} diff --git a/packages/frontend-core/src/components/grid/controls/BulkDeleteHandler.svelte b/packages/frontend-core/src/components/grid/controls/BulkDeleteHandler.svelte index f87b529390..3218ef9ffe 100644 --- a/packages/frontend-core/src/components/grid/controls/BulkDeleteHandler.svelte +++ b/packages/frontend-core/src/components/grid/controls/BulkDeleteHandler.svelte @@ -6,15 +6,9 @@ let modal - $: selectedRowCount = Object.values($selectedRows).filter(x => !!x).length + $: selectedRowCount = Object.values($selectedRows).length $: rowsToDelete = Object.entries($selectedRows) - .map(entry => { - if (entry[1] === true) { - return $rows.find(x => x._id === entry[0]) - } else { - return null - } - }) + .map(entry => $rows.find(x => x._id === entry[0])) .filter(x => x != null) // Deletion callback when confirmed diff --git a/packages/frontend-core/src/components/grid/layout/Grid.svelte b/packages/frontend-core/src/components/grid/layout/Grid.svelte index c4828e2791..8cf5803f23 100644 --- a/packages/frontend-core/src/components/grid/layout/Grid.svelte +++ b/packages/frontend-core/src/components/grid/layout/Grid.svelte @@ -57,6 +57,7 @@ allowEditRows, allowDeleteRows, stripeRows, + showControls, }) // Build up context @@ -91,6 +92,7 @@ allowEditRows, allowDeleteRows, stripeRows, + showControls, }) // Set context for children to consume diff --git a/packages/frontend-core/src/components/grid/layout/NewRow.svelte b/packages/frontend-core/src/components/grid/layout/NewRow.svelte index 4581e37746..06e4f0bfd6 100644 --- a/packages/frontend-core/src/components/grid/layout/NewRow.svelte +++ b/packages/frontend-core/src/components/grid/layout/NewRow.svelte @@ -26,6 +26,8 @@ maxScrollTop, rowVerticalInversionIndex, columnHorizontalInversionIndex, + config, + selectedRows, } = getContext("grid") let visible = false @@ -37,6 +39,7 @@ $: width = GutterWidth + ($stickyColumn?.width || 0) $: $tableId, (visible = false) $: invertY = shouldInvertY(offset, $rowVerticalInversionIndex, $renderedRows) + $: selectedRowCount = Object.values($selectedRows).length const shouldInvertY = (offset, inversionIndex, rows) => { if (offset === 0) { @@ -142,7 +145,7 @@ -{#if !visible} +{#if !visible && !$config.showControls && !selectedRowCount}