Improve grid datasource backwards compatibility
This commit is contained in:
parent
7fd7943a5a
commit
fa90629139
|
@ -5560,7 +5560,8 @@
|
||||||
{
|
{
|
||||||
"type": "dataSource",
|
"type": "dataSource",
|
||||||
"label": "Data",
|
"label": "Data",
|
||||||
"key": "datasource"
|
"key": "table",
|
||||||
|
"required": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "columns/grid",
|
"type": "columns/grid",
|
||||||
|
|
|
@ -4,7 +4,8 @@
|
||||||
import { getContext } from "svelte"
|
import { getContext } from "svelte"
|
||||||
import { Grid } from "@budibase/frontend-core"
|
import { Grid } from "@budibase/frontend-core"
|
||||||
|
|
||||||
export let datasource
|
// table is actually any datasource, but called table for legacy compatibility
|
||||||
|
export let table
|
||||||
export let allowAddRows = true
|
export let allowAddRows = true
|
||||||
export let allowEditRows = true
|
export let allowEditRows = true
|
||||||
export let allowDeleteRows = true
|
export let allowDeleteRows = true
|
||||||
|
@ -16,9 +17,6 @@
|
||||||
export let columns = null
|
export let columns = null
|
||||||
export let onRowClick = null
|
export let onRowClick = null
|
||||||
|
|
||||||
// Legacy settings
|
|
||||||
export let table
|
|
||||||
|
|
||||||
const component = getContext("component")
|
const component = getContext("component")
|
||||||
const { styleable, API, builderStore, notificationStore } = getContext("sdk")
|
const { styleable, API, builderStore, notificationStore } = getContext("sdk")
|
||||||
|
|
||||||
|
@ -42,7 +40,7 @@
|
||||||
class:in-builder={$builderStore.inBuilder}
|
class:in-builder={$builderStore.inBuilder}
|
||||||
>
|
>
|
||||||
<Grid
|
<Grid
|
||||||
datasource={datasource || table}
|
datasource={table}
|
||||||
{API}
|
{API}
|
||||||
{stripeRows}
|
{stripeRows}
|
||||||
{initialFilter}
|
{initialFilter}
|
||||||
|
|
Loading…
Reference in New Issue