From: Mike Rylander Date: Thu, 30 Oct 2014 14:17:49 +0000 (-0400) Subject: LP#1402797 Teach autogrid how to ignore fields explicitly X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=466345920c0f7fa7d3cbb2f97462cd84a05621ba;p=evergreen%2Fmasslnc.git LP#1402797 Teach autogrid how to ignore fields explicitly Signed-off-by: Mike Rylander Signed-off-by: Kathy Lussier --- 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);