mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
Sorting mappable columns
This commit is contained in:
parent
92b7687f75
commit
8e2831ae6a
@ -77,9 +77,11 @@ class ColumnPicker extends Disposable {
|
|||||||
const columnsAsOptions: IOption<number|null>[] = use(canBeMapped)
|
const columnsAsOptions: IOption<number|null>[] = use(canBeMapped)
|
||||||
.map((col) => ({
|
.map((col) => ({
|
||||||
value: col.getRowId(),
|
value: col.getRowId(),
|
||||||
label: col.label.peek(),
|
label: col.label.peek() || '',
|
||||||
icon: 'FieldColumn',
|
icon: 'FieldColumn',
|
||||||
}));
|
}));
|
||||||
|
// Order it by label.
|
||||||
|
columnsAsOptions.sort((a, b) => a.label.localeCompare(b.label));
|
||||||
|
|
||||||
// For optional mappings, add 'Blank' option but only if the value is set.
|
// For optional mappings, add 'Blank' option but only if the value is set.
|
||||||
// This option will allow to clear the selection.
|
// This option will allow to clear the selection.
|
||||||
|
Loading…
Reference in New Issue
Block a user