restore flex for now
authorStephanie Leary <stephanie.leary@equinoxoli.org>
Fri, 17 Mar 2023 20:04:05 +0000 (20:04 +0000)
committerStephanie Leary <stephanie.leary@equinoxoli.org>
Fri, 17 Mar 2023 20:04:05 +0000 (20:04 +0000)
Signed-off-by: Stephanie Leary <stephanie.leary@equinoxoli.org>
Open-ILS/src/eg2/src/app/share/grid/grid.ts

index 9663876..3ae1d50 100644 (file)
@@ -17,6 +17,7 @@ export class GridColumn {
     path: string;
     label: string;
     headerLabel: string;
+    flex: number;
     align: string;
     hidden: boolean;
     visible: boolean;
@@ -83,6 +84,7 @@ export class GridColumn {
         col.name = this.name;
         col.path = this.path;
         col.label = this.label;
+        col.flex = this.flex;
         col.required = this.required;
         col.hidden = this.hidden;
         col.asyncSupportsEmptyTermClick = this.asyncSupportsEmptyTermClick;
@@ -346,6 +348,7 @@ export class GridColumnSet {
         }
 
         if (!col.name) { col.name = col.path; }
+        if (!col.flex) { col.flex = 2; }
         if (!col.align) { col.align = ''; }
         if (!col.label) { col.label = col.name; }
         if (!col.datatype) { col.datatype = 'text'; }
@@ -498,6 +501,7 @@ export class GridColumnSet {
 
             col.visible = true;
             if (colConf.align) { col.align = colConf.align; }
+            if (colConf.flex) { col.flex = colConf.flex; }
             if (colConf.sort)  { col.sort = Number(colConf.sort); }
 
             // Add to new columns array, avoid dupes.
@@ -613,6 +617,7 @@ export interface GridRowFlairEntry {
 
 export class GridColumnPersistConf {
     name: string;
+    flex?: number;
     sort?: number;
     align?: string;
 }