diff --git a/packages/builder/src/components/backend/DataTable/modals/CreateEditRow.svelte b/packages/builder/src/components/backend/DataTable/modals/CreateEditRow.svelte
index 031d3930fd..37aff6ce22 100644
--- a/packages/builder/src/components/backend/DataTable/modals/CreateEditRow.svelte
+++ b/packages/builder/src/components/backend/DataTable/modals/CreateEditRow.svelte
@@ -23,9 +23,9 @@
async function saveRow() {
errors = []
try {
- await API.saveRow({ ...row, tableId: table._id })
+ const res = await API.saveRow({ ...row, tableId: table._id })
notifications.success("Row saved successfully")
- dispatch("updaterows")
+ dispatch("updaterows", res._id)
} catch (error) {
if (error.handled) {
const response = error.json
diff --git a/packages/builder/src/components/backend/DataTable/modals/sheet/SheetCreateRowModal.svelte b/packages/builder/src/components/backend/DataTable/modals/sheet/SheetCreateRowModal.svelte
index d236f0ab83..0cc9446b28 100644
--- a/packages/builder/src/components/backend/DataTable/modals/sheet/SheetCreateRowModal.svelte
+++ b/packages/builder/src/components/backend/DataTable/modals/sheet/SheetCreateRowModal.svelte
@@ -2,13 +2,27 @@
import CreateEditRow from "../../modals/CreateEditRow.svelte"
import { getContext, onMount } from "svelte"
import { Modal } from "@budibase/bbui"
+ import { cloneDeep } from "lodash/fp"
- const { subscribe } = getContext("sheet")
+ const { subscribe, rows } = getContext("sheet")
let modal
- onMount(() => subscribe("add-row", modal.show))
+ let row
+
+ onMount(() =>
+ subscribe("add-row", () => {
+ row = {}
+ modal.show()
+ })
+ )
+ onMount(() =>
+ subscribe("edit-row", rowToEdit => {
+ row = cloneDeep(rowToEdit)
+ modal.show()
+ })
+ )
-
+ rows.actions.refreshRow(e.detail)} />
diff --git a/packages/frontend-core/src/components/sheet/layout/Sheet.svelte b/packages/frontend-core/src/components/sheet/layout/Sheet.svelte
index c4e6ef8aff..ab7d6bb4ba 100644
--- a/packages/frontend-core/src/components/sheet/layout/Sheet.svelte
+++ b/packages/frontend-core/src/components/sheet/layout/Sheet.svelte
@@ -27,7 +27,6 @@
import { clickOutside } from "@budibase/bbui"
import AddRowButton from "../controls/AddRowButton.svelte"
import SheetControls from "./SheetControls.svelte"
- import SidePanel from "./SidePanel.svelte"
export let API
export let tableId
@@ -35,19 +34,21 @@
export let allowSelectRows = true
export let allowAddColumns = true
export let allowEditColumns = true
+ export let allowExpandRows = true
// Sheet constants
const cellHeight = 36
- const gutterWidth = 80
+ const gutterWidth = 72
const rand = Math.random()
// State stores
+ const tableIdStore = writable(tableId)
const config = writable({
- tableId,
allowAddRows,
allowSelectRows,
allowAddColumns,
allowEditColumns,
+ allowExpandRows,
})
// Build up spreadsheet context
@@ -58,6 +59,7 @@
cellHeight,
gutterWidth,
config,
+ tableId: tableIdStore,
}
context = { ...context, ...createEventManagers() }
context = { ...context, ...createBoundsStores(context) }
@@ -76,13 +78,14 @@
// Reference some stores for local use
const { isResizing, isReordering, ui, loaded } = context
- // Keep config store up to date
+ // Keep stores up to date
+ $: tableIdStore.set(tableId)
$: config.set({
- tableId,
allowAddRows,
allowSelectRows,
allowAddColumns,
allowEditColumns,
+ allowExpandRows,
})
// Set context for children to consume
@@ -127,7 +130,6 @@
{/if}
{/if}
-
diff --git a/packages/frontend-core/src/components/sheet/layout/SidePanel.svelte b/packages/frontend-core/src/components/sheet/layout/SidePanel.svelte
deleted file mode 100644
index abdd51c622..0000000000
--- a/packages/frontend-core/src/components/sheet/layout/SidePanel.svelte
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
some content
-
-
diff --git a/packages/frontend-core/src/components/sheet/layout/StickyColumn.svelte b/packages/frontend-core/src/components/sheet/layout/StickyColumn.svelte
index 446bea4f87..782ee58646 100644
--- a/packages/frontend-core/src/components/sheet/layout/StickyColumn.svelte
+++ b/packages/frontend-core/src/components/sheet/layout/StickyColumn.svelte
@@ -1,6 +1,6 @@