LP#1402797 Teach autogrid how to ignore fields explicitly
authorMike Rylander <mrylander@gmail.com>
Thu, 30 Oct 2014 14:17:49 +0000 (10:17 -0400)
committerBill Erickson <berickxx@gmail.com>
Thu, 12 Feb 2015 16:58:26 +0000 (11:58 -0500)
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Open-ILS/web/js/ui/default/staff/services/grid.js

index 9dc5b7d..772f3c6 100644 (file)
@@ -825,6 +825,7 @@ angular.module('egGridMod',
         scope : {
             name  : '@', // required; unique name
             path  : '@', // optional; flesh path
+            ignore: '@', // optional; fields to ignore when path is a wildcard
             label : '@', // optional; display label
             flex  : '@',  // optional; default flex width
             dateformat : '@', // optional: passed down to egGridValueFilter
@@ -986,6 +987,10 @@ angular.module('egGridMod',
         // position in the path.
         cols.expandPath = function(colSpec) {
 
+            var ignoreList = [];
+            if (colSpec.ignore)
+                ignoreList = colSpec.ignore.split(' ');
+
             var dotpath = colSpec.path.replace(/\.?\*$/,'');
             var class_obj;
 
@@ -1029,8 +1034,10 @@ angular.module('egGridMod',
 
                     // Only show wildcard fields where we have data to show
                     // Virtual and un-fleshed links will not have any data.
-                    if (field.virtual || (
-                        field.datatype == 'link' || field.datatype == 'org_unit'))
+                    if (field.virtual ||
+                        (field.datatype == 'link' || field.datatype == 'org_unit') ||
+                        ignoreList.indexOf(field.name) > -1
+                    )
                         return;
 
                     var col = cols.cloneFromScope(colSpec);