[open-ils-commits] r10626 - trunk/Open-ILS/web/vandelay
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Sep 17 16:40:20 EDT 2008
Author: erickson
Date: 2008-09-17 16:40:15 -0400 (Wed, 17 Sep 2008)
New Revision: 10626
Modified:
trunk/Open-ILS/web/vandelay/vandelay.html
trunk/Open-ILS/web/vandelay/vandelay.js
Log:
added paging to queued recs grid
Modified: trunk/Open-ILS/web/vandelay/vandelay.html
===================================================================
--- trunk/Open-ILS/web/vandelay/vandelay.html 2008-09-17 18:59:05 UTC (rev 10625)
+++ trunk/Open-ILS/web/vandelay/vandelay.html 2008-09-17 20:40:15 UTC (rev 10626)
@@ -47,7 +47,7 @@
border: 1px solid red;
}
</style>
- <script type="text/javascript" djConfig="parseOnLoad: true,isDebug:true" src="/js/dojo/dojo/dojo.js"></script>
+ <script type="text/javascript" djConfig="parseOnLoad: true,isDebug:false" src="/js/dojo/dojo/dojo.js"></script>
<script type="text/javascript" src='/js/dojo/openils/MarcXPathParser.js'></script>
<script type="text/javascript" src='vandelay.js'></script>
</head>
@@ -143,11 +143,33 @@
}
</script>
<div id='vl-queue-div-grid' class='tall'>
- <button dojoType='dijit.form.Button' onclick='vlSelectAllGridRecords();'>Select All</button>
- <button dojoType='dijit.form.Button' onclick='vlSelectNoGridRecords();'>Select None</button>
- <button dojoType='dijit.form.Button' onclick='vlImportSelectedRecords();'>Import Selected</button>
- Only show records with possible matches <input dojoType='dijit.form.CheckBox' jsId='vlQueueGridShowMatches'
- checked='checked' onclick='retrieveQueuedRecords(currentType, currentQueueId, handleRetrieveRecords)'/>
+ <table width='100%'>
+ <tr><td align='left'>
+ <button dojoType='dijit.form.Button' onclick='vlSelectAllGridRecords();'>Select All</button>
+ <button dojoType='dijit.form.Button' onclick='vlSelectNoGridRecords();'>Select None</button>
+ <button dojoType='dijit.form.Button' onclick='vlImportSelectedRecords();'>Import Selected</button>
+ </td>
+ <td align='right'>
+ <span style='padding-right:4px;'>
+ <a href='javascript:void(0);' onclick='
+ var page = parseInt(vlQueueDisplayPage.getValue());
+ if(page < 2) return;
+ vlQueueDisplayPage.setValue(page - 1);
+ retrieveQueuedRecords(currentType, currentQueueId, handleRetrieveRecords);'>« Previous Page</a>
+ </span>
+ <span style='padding-right:4px;'>
+ <a href='javascript:void(0);' onclick='
+ vlQueueDisplayPage.setValue(parseInt(vlQueueDisplayPage.getValue())+1);
+ retrieveQueuedRecords(currentType, currentQueueId, handleRetrieveRecords);'>Next Page »</a>
+ </span>
+ Only show possible matches
+ <input dojoType='dijit.form.CheckBox' jsId='vlQueueGridShowMatches' checked='checked'/>
+ Page Size <input style='width:36px;' dojoType='dijit.form.TextBox' jsId='vlQueueDisplayLimit' value='10'/>
+ Page <input style='width:36px;' dojoType='dijit.form.TextBox' jsId='vlQueueDisplayPage' value='1'/>
+ <button dojoType='dijit.form.Button'
+ onclick='retrieveQueuedRecords(currentType, currentQueueId, handleRetrieveRecords)'>Refresh</button>
+ </td></tr>
+ </table>
<div class='tall'>
<div dojoType='dojox.Grid' jsId='vlQueueGrid' class='tall'> </div>
</div>
Modified: trunk/Open-ILS/web/vandelay/vandelay.js
===================================================================
--- trunk/Open-ILS/web/vandelay/vandelay.js 2008-09-17 18:59:05 UTC (rev 10625)
+++ trunk/Open-ILS/web/vandelay/vandelay.js 2008-09-17 20:40:15 UTC (rev 10626)
@@ -238,10 +238,18 @@
if(vlQueueGridShowMatches.checked)
method = method.replace('records', 'records.matches');
+ var limit = parseInt(vlQueueDisplayLimit.getValue());
+ var offset = limit * parseInt(vlQueueDisplayPage.getValue()-1);
+
fieldmapper.standardRequest(
['open-ils.vandelay', method],
{ async: true,
- params: [authtoken, queueId, {clear_marc:1}],
+ params: [authtoken, queueId,
+ { clear_marc: 1,
+ offset: offset,
+ limit: limit
+ }
+ ],
/* intermittent bug in streaming, multipart requests prevents use of onreponse for now...
onresponse: function(r) {
var rec = r.recv().content();
@@ -457,7 +465,7 @@
currentOverlayRecordsMap = {};
- if(queuedRecords.length == 0) {
+ if(queuedRecords.length == 0 && vlQueueDisplayPage.getValue() == 1) {
dojo.style(dojo.byId('vl-queue-no-records'), 'display', 'block');
dojo.style(dojo.byId('vl-queue-div-grid'), 'display', 'none');
return;
More information about the open-ils-commits
mailing list