LP1821382 Grid showDeclaredFieldsOnly option; sort repair.
[evergreen-equinox.git] / Open-ILS / src / eg2 / src / app / share / grid / grid.ts
index fc50f59..b133d1a 100644 (file)
@@ -130,7 +130,7 @@ export class GridColumnSet {
                 if (idx === 0) {
                     this.columns.unshift(col);
                 } else {
-                    this.columns.splice(idx - 1, 0, col);
+                    this.columns.splice(idx, 0, col);
                 }
                 return true;
             }
@@ -444,6 +444,7 @@ export class GridContext {
     overflowCells: boolean;
     showLinkSelectors: boolean;
     disablePaging: boolean;
+    showDeclaredFieldsOnly: boolean;
 
     // Allow calling code to know when the select-all-rows-in-page
     // action has occurred.
@@ -990,6 +991,10 @@ export class GridContext {
                 }
             }
 
+            if (this.showDeclaredFieldsOnly) {
+                col.hidden = true;
+            }
+
             this.columnSet.add(col);
         });
     }