Use real schema for datatable rather than first row's keys

This commit is contained in:
Andrew Kingston 2020-10-06 16:39:24 +01:00
parent a12ddaaf08
commit 63635f3642
1 changed files with 3 additions and 1 deletions

View File

@ -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)
</script>
<table use:cssVars={cssVariables}>