if (column_extras['*']['expanded_label']) {
def.label = my_class.label + ': ' + def.label;
}
+ if (column_extras['*']['remove_virtual']) {
+ if (my_field.virtual) {
+ def.remove_me = true;
+ }
+ }
}
if (column_extras[col_id]) {
for (var attr in column_extras[col_id]) {
def[attr] = column_extras[col_id][attr];
}
+ if (column_extras[col_id]['keep_me']) {
+ def.remove_me = false;
+ }
}
}
- return def;
+ if (def.remove_me) {
+ dump('Skipping ' + def.label + '\n');
+ return null;
+ } else {
+ dump('Defining ' + def.label + '\n');
+ return def;
+ }
}
for (var i = 0; i < my_class.fields.length; i++) {
var my_field = my_class.fields[i];
- columns.push( col_def(my_field) );
+ var def = col_def(my_field);
+ if (def) {
+ columns.push( def );
+ }
}
} catch(E) {
JSAN.use('util.list'); obj.list = new util.list('patron_list');
JSAN.use('patron.util');
- var columns = patron.util.columns(
- {
- /* 'active' : { 'hidden' : 'false' }, */
- 'barred' : { 'hidden' : 'false' },
- 'family_name' : { 'hidden' : 'false' },
- 'first_given_name' : { 'hidden' : 'false' },
- 'second_given_name' : { 'hidden' : 'false' },
- 'dob' : { 'hidden' : obscure_dob }
- },
- {
- 'except_these' : [
- 'au_barcode',
- ]
- }
- );
+ var columns = obj.list.fm_columns('au',{
+ '*' : { 'remove_virtual' : true, 'expanded_label' : false, 'hidden' : true },
+ 'au_barcode' : { 'hidden' : false },
+ 'au_barred' : { 'hidden' : false },
+ 'au_family_name' : { 'hidden' : false },
+ 'au_first_given_name' : { 'hidden' : false },
+ 'au_second_given_name' : { 'hidden' : false },
+ 'au_dob' : { 'hidden' : false }
+ });
obj.list.init(
{
'columns' : columns,