From: phasefx Date: Wed, 18 Nov 2009 16:35:49 +0000 (+0000) Subject: With fm_columns, hide by default any virtual field and any field with a datatype... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=917996f1330c91b053d35cf8a42f184626c02e5c;p=contrib%2FConifer.git With fm_columns, hide by default any virtual field and any field with a datatype of link. For rendering values for link fields, if the data encountered is an object, flatten it by using the field's .key value as a method against the object. git-svn-id: svn://svn.open-ils.org/ILS/trunk@14955 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/xul/staff_client/chrome/content/util/list.js b/Open-ILS/xul/staff_client/chrome/content/util/list.js index 3ff99e764f..c7e6209dc7 100644 --- a/Open-ILS/xul/staff_client/chrome/content/util/list.js +++ b/Open-ILS/xul/staff_client/chrome/content/util/list.js @@ -1628,11 +1628,17 @@ util.list.prototype = { 'id' : col_id, 'label' : my_field.label || my_field.name, 'sort_type' : [ 'int', 'float', 'id', 'number' ].indexOf(my_field.datatype) > -1 ? 'number' : ( my_field.datatype == 'money' ? 'money' : 'default'), - 'hidden' : [ 'isnew', 'ischanged', 'isdeleted' ].indexOf(my_field.name) > -1, + 'hidden' : my_field.virtual || my_field.datatype == 'link', 'flex' : 1 }; // my_field.datatype => bool float id int interval link money number org_unit text timestamp - def.render = function(my) { return my[hint][my_field.name](); } + if (my_field.datatype == 'link') { + def.render = function(my) { + return typeof my[hint][my_field.name]() == 'object' ? my[hint][my_field.name]()[my_field.key]() : my[hint][my_field.name](); + } + } else { + def.render = function(my) { return my[hint][my_field.name](); } + } if (my_field.datatype == 'timestamp') { dojo.require('dojo.date.locale'); dojo.require('dojo.date.stamp');