persist-key="eg.staff.circ.patron.items_out"
eg-list="items_out"
id-field="id">
- <eg-grid-field name="id"></eg-grid-field>
- <eg-grid-field
- name="target_copy.barcode"
- path="target_copy.barcode"
- flex="3"
- label="[% l('Barcode') %]">
- </eg-grid-field>
- <eg-grid-field
- name="due_date"
- label="[% l('Due Date') %]">
- </eg-grid-field>
- <eg-grid-field
- name="circ_lib.shortname"
- path="circ_lib.shortname"
- label="[% l('Circ Lib') %]">
- </eg-grid-field>
- <eg-grid-field name="renewal_remaining"></eg-grid-field>
- <eg-grid-field name="stop_fines"></eg-grid-field>
- <eg-grid-field
- name="title"
- flex="5"
- label="[% l('Title') %]"
- path="target_copy.call_number.record.simple_record.title">
- </eg-grid-field>
+ <eg-grid-field path="id"></eg-grid-field>
+ <eg-grid-field path="target_copy.barcode" flex="3" label="[% l('Barcode') %]"> </eg-grid-field>
+ <eg-grid-field path="due_date" label="[% l('Due Date') %]"></eg-grid-field>
+ <eg-grid-field path="circ_lib.shortname" label="[% l('Circ Lib') %]"></eg-grid-field>
+ <eg-grid-field path="renewal_remaining"></eg-grid-field>
+ <eg-grid-field path="stop_fines"></eg-grid-field>
+ <eg-grid-field flex="5" label="[% l('Title') %]"
+ path="target_copy.call_number.record.simple_record.title"> </eg-grid-field>
</eg-grid>
<!-- TODO: row-level styling, alerts, etc. (e.g. overdue) -->
ng-repeat="column in list.allColumns"
style="flex:{{column.flex}}"
ng-show="list.displayColumns[column.name]">
- {{list.fieldValue(item, column.path) | egGridvalueFilter:column}}
+ {{fieldValue(item, column.name) | egGridvalueFilter:column}}
</div>
</div>
</div>
eg-grid-field's require closing tags;
you can also do <div eg-grid-tag attrs..></div>
-->
- <eg-grid-field name="shortname" label="[% l('Shortname') %]"></eg-grid-field>
- <eg-grid-field name="name" flex="5"></eg-grid-field>
- <eg-grid-field name="id"></eg-grid-field>
- <eg-grid-field name="depth" path="ou_type.depth"></eg-grid-field>
- <eg-grid-field name="billing_addr" flex="3"path="billing_address.street1"></eg-grid-field>
- <eg-grid-field name="opac_visible"></eg-grid-field>
- <eg-grid-field name="phone"></eg-grid-field>
- <eg-grid-field name="email"></eg-grid-field>
- <eg-grid-field name="type" path="ou_type.name" flex="3"></eg-grid-field>
- <eg-grid-field name="can_have_vols" path="ou_type.can_have_vols"></eg-grid-field>
- <eg-grid-field name="can_have_users" path="ou_type.can_have_users"></eg-grid-field>
- <eg-grid-field name="parent_ou_id" path="parent_ou.id"></eg-grid-field>
- <eg-grid-field name="parent_ou_name" path="parent_ou.name" flex="5" label="[% l('Parent Org') %]"></eg-grid-field>
- <eg-grid-field name="parent_ou_depth" path="parent_ou.ou_type.depth" label="[% l('Parent Depth') %]"></eg-grid-field>
- <eg-grid-field name="parent_ou_shortname" path="parent_ou.shortname" label="[% l('Parent SN') %]"></eg-grid-field>
+ <eg-grid-field path="shortname" label="[% l('Shortname') %]"></eg-grid-field>
+ <eg-grid-field path="name" flex="5"></eg-grid-field>
+ <eg-grid-field path="id"></eg-grid-field>
+ <eg-grid-field path="ou_type.depth"></eg-grid-field>
+ <eg-grid-field path="billing_address.street1" flex="3"></eg-grid-field>
+ <eg-grid-field path="opac_visible"></eg-grid-field>
+ <eg-grid-field path="phone"></eg-grid-field>
+ <eg-grid-field path="email"></eg-grid-field>
+ <eg-grid-field path="ou_type.name" flex="3"></eg-grid-field>
+ <eg-grid-field path="ou_type.can_have_vols"></eg-grid-field>
+ <eg-grid-field path="ou_type.can_have_users"></eg-grid-field>
+ <eg-grid-field path="parent_ou.id"></eg-grid-field>
+ <eg-grid-field path="parent_ou.name" flex="5" label="[% l('Parent Org') %]"></eg-grid-field>
+ <eg-grid-field path="parent_ou.ou_type.depth" label="[% l('Parent Depth') %]"></eg-grid-field>
+ <eg-grid-field path="parent_ou.shortname" label="[% l('Parent SN') %]"></eg-grid-field>
</eg-grid>
<!--
$scope.list = $scope.egList || egList.create();
- $scope.$watch('isScroll', function(newValue, oldValue) {
- console.log('isScroll changed to ' + newValue) });
-
// column-header click quick sort
$scope.sortOn = function(col_name) {
if ($scope.sort && $scope.sort.length &&
this.addColumn = function(fieldSpec) {
var field = {
- name : fieldSpec.name,
+ name : fieldSpec.name,
label : fieldSpec.label,
- path : fieldSpec.path,
- flex : fieldSpec.flex,
+ path : fieldSpec.path,
+ flex : fieldSpec.flex,
datatype : fieldSpec.datatype,
- display : (fieldSpec.display !== false)
+ display : (fieldSpec.display !== false)
};
- if (!field.path) field.path = field.name;
+
if (!field.name) field.name = field.path;
+ if (!field.path) field.path = field.name;
+
field = self.absorbField(field);
$scope.list.addColumn(field);
}
+ $scope.fieldValue = function(item, key) {
+ if ($scope.egList)
+ return $scope.list.fieldValue(item, key);
+ // if we are managing the data, then our data is flat
+ return item[key];
+ }
+
/**
* Caller wants to display all fields for the selected IDL class
* Find the fields and, when a field is a link, fetch the label
var new_field = {
name : field.name,
label : field.label,
- path : field.path || field.name,
+ path : field.path,
flex : Number(field.flex) || 2,
display : (field.display === false) ? false : true
};
* To avoid ambiguity, automatically added column labels are
* prefixed with the class label.
*/
+ /* TODO: deprecate me with grid.js */
this.addColumnsForClass = function(cls, base) {
var idlClass = egIDL.classes[cls];
angular.forEach(idlClass.fields, function(field) {
// corresponding output filter.
// TODO: support modifying field values --
// useful for inline table editing
+
+ // TODO: this can be trimmed down, specifically the filter
+ // stuff in light of grid.js
this.fieldValue = function(obj, dotpath) {
if (!obj) return '';
if (!dotpath) return obj;