From e91b62ef2ee1fc1e24aa2fce881853d33c91faec Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 6 Oct 2020 16:39:24 +0100 Subject: [PATCH] Use real schema for datatable rather than first row's keys --- packages/standard-components/src/DataTable.svelte | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/standard-components/src/DataTable.svelte b/packages/standard-components/src/DataTable.svelte index a7712c6726..7b81b18bbb 100644 --- a/packages/standard-components/src/DataTable.svelte +++ b/packages/standard-components/src/DataTable.svelte @@ -42,7 +42,7 @@ data = await fetchData(datasource) if (data && data.length) { await fetchModel(data[0].modelId) - headers = Object.keys(data[0]).filter(shouldDisplayField) + headers = Object.keys(schema).filter(shouldDisplayField) } } }) @@ -71,6 +71,8 @@ direction: "asc", } } + + $: console.log(headers)