Angular grid column picker displays colums in the following order:
1. Visible colums first, sorted alphabetically.
2. Non-visible columns second, sorted alphabetically.
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Mike Risher <mrisher@catalyte.io>
Signed-off-by: Jane Sandberg <sandbej@linnbenton.edu>
Signed-off-by: Jane Sandberg <js7389@princeton.edu>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
this.columns.filter(c => c.required && !c.visible));
}
+ // Sorted visible columns followed by sorted non-visible columns.
+ // Note we don't sort this.columns directly as it would impact
+ // grid column display ordering.
+ sortForColPicker(): GridColumn[] {
+ const visible = this.columns.filter(c => c.visible);
+ const invisible = this.columns.filter(c => !c.visible);
+
+ visible.sort((a, b) => a.label < b.label ? -1 : 1);
+ invisible.sort((a, b) => a.label < b.label ? -1 : 1);
+
+ return visible.concat(invisible);
+ }
+
insertBefore(source: GridColumn, target: GridColumn) {
let targetIdx = -1;
let sourceIdx = -1;