Browse Source

Update client table component to be more generic about passing table customisation options

pull/4608/head
Andrew Kingston 5 years ago
parent
commit
34cdf90b67
  1. 12
      packages/client/src/components/app/table/Table.svelte

12
packages/client/src/components/app/table/Table.svelte

@ -86,11 +86,13 @@
if (UnsortableTypes.includes(schema[columnName].type)) { if (UnsortableTypes.includes(schema[columnName].type)) {
newSchema[columnName].sortable = false newSchema[columnName].sortable = false
} }
if (field?.displayName) {
newSchema[columnName].displayName = field?.displayName // Add additional settings like width etc
} if (typeof field === "object") {
if (field?.width) { newSchema[columnName] = {
newSchema[columnName].width = field?.width ...newSchema[columnName],
...field,
}
} }
}) })
return newSchema return newSchema

Loading…
Cancel
Save