From 466345920c0f7fa7d3cbb2f97462cd84a05621ba Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Thu, 30 Oct 2014 10:17:49 -0400 Subject: [PATCH] LP#1402797 Teach autogrid how to ignore fields explicitly Signed-off-by: Mike Rylander Signed-off-by: Kathy Lussier --- Open-ILS/web/js/ui/default/staff/services/grid.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Open-ILS/web/js/ui/default/staff/services/grid.js b/Open-ILS/web/js/ui/default/staff/services/grid.js index 9dc5b7d851..772f3c6112 100644 --- a/Open-ILS/web/js/ui/default/staff/services/grid.js +++ b/Open-ILS/web/js/ui/default/staff/services/grid.js @@ -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); -- 2.11.0