Use friendly names in sort dropdown£
This commit is contained in:
parent
943d17966e
commit
b44e6ddea6
|
@ -17,9 +17,18 @@
|
||||||
const getColumnOptions = (stickyColumn, columns) => {
|
const getColumnOptions = (stickyColumn, columns) => {
|
||||||
let options = []
|
let options = []
|
||||||
if (stickyColumn) {
|
if (stickyColumn) {
|
||||||
options.push(stickyColumn.name)
|
options.push({
|
||||||
|
label: stickyColumn.label || stickyColumn.name,
|
||||||
|
value: stickyColumn.name,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
return [...options, ...columns.map(col => col.name)]
|
return [
|
||||||
|
...options,
|
||||||
|
...columns.map(col => ({
|
||||||
|
label: col.label || col.name,
|
||||||
|
value: col.name,
|
||||||
|
})),
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
const updateSortColumn = e => {
|
const updateSortColumn = e => {
|
||||||
|
@ -66,7 +75,7 @@
|
||||||
quiet
|
quiet
|
||||||
size="M"
|
size="M"
|
||||||
on:click={() => (open = !open)}
|
on:click={() => (open = !open)}
|
||||||
selected={open || $sort.column}
|
selected={open}
|
||||||
disabled={!columnOptions.length}
|
disabled={!columnOptions.length}
|
||||||
>
|
>
|
||||||
Sort
|
Sort
|
||||||
|
|
Loading…
Reference in New Issue