main-label="[% l('Items Checked Out') %]"
items-provider="gridDataProvider"
persist-key="eg.staff.circ.patron.items_out">
- <eg-grid-field label="[% ('Circ ID') %]" path='id' visible></eg-grid-field>
- <eg-grid-field label="[% ('Barcode') %]" path='target_copy.barcode' visible></eg-grid-field>
+ <eg-grid-field label="[% l('Circ ID') %]" path='id' visible></eg-grid-field>
+ <eg-grid-field label="[% l('Barcode') %]" path='target_copy.barcode' visible></eg-grid-field>
<eg-grid-field label="[% l('Due Date') %]" path='due_date' visible></eg-grid-field>
<eg-grid-field label="[% l('Checkout / Renewal Library') %]" path='circ_lib.shortname' visible></eg-grid-field>
<eg-grid-field label="[% l('Renewals Remaining') %]" path='renewal_remaining' visible></eg-grid-field>
// optional primary grid label
mainLabel : '@',
- // if true, use the IDL class label as the mainLael
+ // if true, use the IDL class label as the mainLabel
autoLabel : '=',
+ // called on each item retrieved in collect() with the item
+ // as the argument. Useful for modiying objects before they
+ // are absorbed by the grid.
+ onItemRetrieved : '=',
+
// optional context menu label
menuLabel : '@'
},
grid.showGridConf = false;
grid.dataProvider = $scope.itemsProvider;
grid.menuLabel = $scope.menuLabel;
+ grid.onItemRetrieved = $scope.onItemRetrieved;
grid.menuItems = [];
grid.addMenuItem = function(item) {
grid.selected = {};
grid.dataProvider.get(grid.offset, grid.limit)
.then(null, null, function(item) {
- if (item) grid.items.push(item)
+ if (item) {
+ if (grid.onItemRetrieved)
+ grid.onItemRetrieved(item);
+ grid.items.push(item)
+ }
});
}
'nonsortable',
'multisortable',
'nonmultisortable',
+ 'required' // if set, always fetch data for this column
],
function(field) {
if (angular.isDefined(attrs[field]))
path : colSpec.path,
flex : Number(colSpec.flex) || 2,
sort : Number(colSpec.sort) || 0,
+ required : colSpec.required,
visible : colSpec.visible,
hidden : colSpec.hidden,
datatype : colSpec.datatype,
var queryFields = {}
angular.forEach(provider.columnsProvider.columns,
function(col) {
- if (provider.columnsProvider.visible[col.name])
+ if (col.required ||
+ provider.columnsProvider.visible[col.name])
queryFields[col.name] = col.path;
}
);