Use real schema for datatable rather than first row's keys
This commit is contained in:
parent
11c4f237d3
commit
e91b62ef2e
|
@ -42,7 +42,7 @@
|
||||||
data = await fetchData(datasource)
|
data = await fetchData(datasource)
|
||||||
if (data && data.length) {
|
if (data && data.length) {
|
||||||
await fetchModel(data[0].modelId)
|
await fetchModel(data[0].modelId)
|
||||||
headers = Object.keys(data[0]).filter(shouldDisplayField)
|
headers = Object.keys(schema).filter(shouldDisplayField)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -71,6 +71,8 @@
|
||||||
direction: "asc",
|
direction: "asc",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$: console.log(headers)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<table use:cssVars={cssVariables}>
|
<table use:cssVars={cssVariables}>
|
||||||
|
|
Loading…
Reference in New Issue