From 96e59e6149d93778dea37ec05a6644a80459c443 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 22 Mar 2021 11:29:26 +0000 Subject: [PATCH] Update list autoscreen to use new data provider --- .../store/screenTemplates/rowListScreen.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/packages/builder/src/builderStore/store/screenTemplates/rowListScreen.js b/packages/builder/src/builderStore/store/screenTemplates/rowListScreen.js index c999c22647..092eca0702 100644 --- a/packages/builder/src/builderStore/store/screenTemplates/rowListScreen.js +++ b/packages/builder/src/builderStore/store/screenTemplates/rowListScreen.js @@ -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")