1
0
Fork 0
mirror of synced 2024-06-29 03:20:34 +12:00

Improve table column sorting to put auto cols last

This commit is contained in:
Andrew Kingston 2021-03-24 19:13:38 +00:00
parent 124ff6b089
commit 63fb0b5b5d
2 changed files with 6 additions and 3 deletions

View file

@ -1529,7 +1529,7 @@
},
{
"type": "boolean",
"label": "Show Auto Cols.",
"label": "Auto Cols.",
"key": "showAutoColumns",
"defaultValue": false
},

View file

@ -65,12 +65,15 @@
return customColumns
}
let columns = []
let autoColumns = []
Object.entries(schema).forEach(([field, fieldSchema]) => {
if (showAutoColumns || !fieldSchema?.autocolumn) {
if (!fieldSchema?.autocolumn) {
columns.push(field)
} else if (showAutoColumns) {
autoColumns.push(field)
}
})
return columns
return columns.concat(autoColumns)
}
</script>