1
0
Fork 0
mirror of synced 2024-09-30 00:57:16 +13:00

Update list autoscreen to use new data provider

This commit is contained in:
Andrew Kingston 2021-03-22 11:29:26 +00:00
parent 521a282aef
commit 96e59e6149

View file

@ -70,14 +70,20 @@ function generateTitleContainer(table) {
}
const createScreen = table => {
const datagrid = new Component("@budibase/standard-components/datagrid")
const provider = new Component("@budibase/standard-components/dataprovider")
.instanceName(`Data Provider`)
.customProps({
datasource: {
dataSource: {
label: table.name,
name: `all_${table._id}`,
tableId: table._id,
type: "table",
},
})
const grid = new Component("@budibase/standard-components/datagrid")
.customProps({
dataProvider: `{{ literal ${provider._json._id} }}`,
editable: false,
theme: "alpine",
height: "540",
@ -86,6 +92,8 @@ const createScreen = table => {
})
.instanceName("Grid")
provider.addChild(grid)
const mainContainer = new Component("@budibase/standard-components/container")
.normalStyle({
background: "white",
@ -105,7 +113,7 @@ const createScreen = table => {
.type("div")
.instanceName("Container")
.addChild(generateTitleContainer(table))
.addChild(datagrid)
.addChild(provider)
return new Screen()
.component("@budibase/standard-components/container")