</a>
</eg-grid-field>
- <eg-grid-field label="[% l('Patron Barcode') %]">{{item.patron_barcode}}</eg-grid-field>
- <eg-grid-field label="[% l('Patron alias') %]">{{item.patron_alias}}</eg-grid-field>
+ <eg-grid-field label="[% l('Patron Barcode') %]" path='patron_barcode'></eg-grid-field>
+ <eg-grid-field label="[% l('Patron alias') %]" path='patron_alias'></eg-grid-field>
<eg-grid-field label="[% l('Request Date') %]" path='hold.request_time' datatype="timestamp"></eg-grid-field>
<eg-grid-field label="[% l('Capture Date') %]" path='hold.capture_time' datatype="timestamp"></eg-grid-field>
<eg-grid-field label="[% l('Available Date') %]" path='hold.shelf_time' datatype="timestamp"></eg-grid-field>
$scope.grid_actions.refresh = function () { provider.refresh() };
$scope.hold_grid_controls = {};
- var hold_ids = []; // current list of holds
+ var holds = []; // actual hold objs for caching
+ var hold_ids = []; // current list of hold ids
+
function fetchHolds(offset, count) {
var ids = hold_ids.slice(offset, offset + count);
return egHolds.fetch_holds(ids).then(null, null,
- function(hold_data) {
+ function(hold_data) {
+ holds.push(hold_data);
return hold_data;
}
);
provider.get = function(offset, count) {
if ($scope.record_tab != 'holds') return $q.when();
var deferred = $q.defer();
- hold_ids = []; // no caching ATM
+ // see if we can use cached results
+ if (holds[offset]){
+ return provider.arrayNotifier(holds, offset, count);
+ }
// open a determinate progress dialog, max value set below.
egProgressDialog.open({max : 1, value : 0});