Improve table column sorting to put auto cols last
This commit is contained in:
parent
19c659fa16
commit
b9c8214476
|
@ -1529,7 +1529,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"label": "Show Auto Cols.",
|
"label": "Auto Cols.",
|
||||||
"key": "showAutoColumns",
|
"key": "showAutoColumns",
|
||||||
"defaultValue": false
|
"defaultValue": false
|
||||||
},
|
},
|
||||||
|
|
|
@ -65,12 +65,15 @@
|
||||||
return customColumns
|
return customColumns
|
||||||
}
|
}
|
||||||
let columns = []
|
let columns = []
|
||||||
|
let autoColumns = []
|
||||||
Object.entries(schema).forEach(([field, fieldSchema]) => {
|
Object.entries(schema).forEach(([field, fieldSchema]) => {
|
||||||
if (showAutoColumns || !fieldSchema?.autocolumn) {
|
if (!fieldSchema?.autocolumn) {
|
||||||
columns.push(field)
|
columns.push(field)
|
||||||
|
} else if (showAutoColumns) {
|
||||||
|
autoColumns.push(field)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
return columns
|
return columns.concat(autoColumns)
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue