[open-ils-commits] r11535 - trunk/Open-ILS/web/js/ui/default/acq/po
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Dec 11 17:15:16 EST 2008
Author: erickson
Date: 2008-12-11 17:15:11 -0500 (Thu, 11 Dec 2008)
New Revision: 11535
Modified:
trunk/Open-ILS/web/js/ui/default/acq/po/search.js
Log:
moved to dynamic grid rendering
Modified: trunk/Open-ILS/web/js/ui/default/acq/po/search.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/acq/po/search.js 2008-12-11 22:11:38 UTC (rev 11534)
+++ trunk/Open-ILS/web/js/ui/default/acq/po/search.js 2008-12-11 22:15:11 UTC (rev 11535)
@@ -3,12 +3,14 @@
dojo.require('dijit.form.FilteringSelect');
dojo.require('dijit.form.NumberTextBox');
dojo.require('dojox.grid.DataGrid');
+dojo.require('dojo.data.ItemFileWriteStore');
dojo.require('openils.acq.Provider');
dojo.require('fieldmapper.OrgUtils');
dojo.require('dojo.date.locale');
dojo.require('dojo.date.stamp');
dojo.require('openils.User');
dojo.require('openils.Util');
+dojo.require('openils.acq.PO');
dojo.require('openils.widget.OrgUnitFilteringSelect');
@@ -38,27 +40,26 @@
}
function doSearch(fields) {
- var itemList = [];
if(!isNaN(fields.id))
fields = {id:fields.id};
else
delete fields.id;
+ var store = new dojo.data.ItemFileWriteStore({data:acqpo.initStoreData()});
+ poGrid.setStore(store);
+ poGrid.render();
+
fieldmapper.standardRequest(
['open-ils.acq', 'open-ils.acq.purchase_order.search'],
- {
- async:1,
+ { async:1,
params: [openils.User.authtoken, fields],
onresponse : function(r) {
- var msg = r.recv();
- if(msg) itemList.push(msg.content());
- },
- oncomplete : function(r) {
+ if(po = openils.Util.readResponse(r)) {
+ openils.acq.PO.cache[po.id()] = po;
+ store.newItem(acqpo.itemToStoreData(po));
+ }
dojo.style('po-grid', 'visibility', 'visible');
- var store = new dojo.data.ItemFileReadStore({data:acqpo.toStoreData(itemList)});
- poGrid.setStore(store);
- poGrid.render();
- },
+ }
}
);
}
More information about the open-ils-commits
mailing list