added paging to user picklist retrieval/display
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 29 Apr 2010 15:14:20 +0000 (15:14 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 29 Apr 2010 15:14:20 +0000 (15:14 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@16344 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Acq/Picklist.pm
Open-ILS/web/js/ui/default/acq/picklist/view_list.js
Open-ILS/web/templates/default/acq/picklist/list.tt2

index d9b6c83..fb7e72e 100644 (file)
@@ -193,11 +193,18 @@ sub retrieve_user_picklist {
     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}
     );
index 740f233..cff62ae 100644 (file)
@@ -15,8 +15,12 @@ var listAll = false;
 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)
@@ -25,13 +29,25 @@ function loadGrid() {
     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();
+            }
         }
     );
 }
index 026392c..15c2372 100644 (file)
@@ -88,6 +88,7 @@
             query="{id: '*'}"
             defaultCellWidth='"auto"'
             fmClass='acqpl'
+            showPaginator='true'
             editOnEnter='true'>
         <thead>
             <tr>