my($self, $conn, $auth, $options) = @_;
my $e = new_editor(authtoken=>$auth);
return $e->die_event unless $e->checkauth;
+ $options ||= {};
# don't grab the PL with name == "", because that is the designated temporary picklist
my $list = $e->search_acq_picklist([
- {owner=>$e->requestor->id, name=>{'!='=>''}},
- {order_by => {acqpl => 'name'}}
+ {
+ owner=>$e->requestor->id,
+ name=>{'!='=>''}
+ }, {
+ order_by => {acqpl => 'name'},
+ limit => $$options{limit} || 10,
+ offset => $$options{offset} || 0,
+ }
],
{idlist=>1}
);
var plCache = {};
function loadGrid() {
-
dojo.connect(plMergeDialog, 'onOpen', function(){loadLeadPlSelector();});
+ plListGrid.dataLoader = gridDataLoader;
+ gridDataLoader();
+}
+
+function gridDataLoader() {
var method = 'open-ils.acq.picklist.user.retrieve';
if(listAll)
fieldmapper.standardRequest(
['open-ils.acq', method],
{ async: true,
- params: [openils.User.authtoken, {flesh_lineitem_count:1, flesh_owner:1}],
+ params: [
+ openils.User.authtoken,
+ {
+ flesh_lineitem_count:1,
+ flesh_owner:1,
+ offset : plListGrid.displayOffset,
+ limit : plListGrid.displayLimit,
+ }
+ ],
onresponse : function(r) {
var pl = openils.Util.readResponse(r);
- if(!pl) return;
- plCache[pl.id()] = pl;
- plListGrid.store.newItem(acqpl.toStoreItem(pl));
+ if(pl) {
+ plCache[pl.id()] = pl;
+ plListGrid.store.newItem(acqpl.toStoreItem(pl));
+ }
},
+ oncomplete : function() {
+ plListGrid.hideLoadProgressIndicator();
+ }
}
);
}