[open-ils-commits] r11532 - trunk/Open-ILS/web/js/ui/default/acq/financial
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Dec 11 17:01:32 EST 2008
Author: erickson
Date: 2008-12-11 17:01:27 -0500 (Thu, 11 Dec 2008)
New Revision: 11532
Modified:
trunk/Open-ILS/web/js/ui/default/acq/financial/list_currency_types.js
Log:
streaming grid building
Modified: trunk/Open-ILS/web/js/ui/default/acq/financial/list_currency_types.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/acq/financial/list_currency_types.js 2008-12-11 21:48:27 UTC (rev 11531)
+++ trunk/Open-ILS/web/js/ui/default/acq/financial/list_currency_types.js 2008-12-11 22:01:27 UTC (rev 11532)
@@ -1,7 +1,7 @@
dojo.require("dijit.Dialog");
dojo.require('dijit.form.Button');
dojo.require('dojox.grid.DataGrid');
-dojo.require('dojo.data.ItemFileReadStore');
+dojo.require('dojo.data.ItemFileWriteStore');
dojo.require('openils.acq.CurrencyType');
dojo.require('openils.Event');
dojo.require('openils.Util');
@@ -10,13 +10,20 @@
var currencyTypes = [];
function loadCTypesGrid() {
- openils.acq.CurrencyType.fetchAll(
- function(types) {
- var store = new dojo.data.ItemFileReadStore(
- {data:acqct.toStoreData(types, 'code', {identifier:'code'})});
-
- currencyTypeListGrid.setStore(store);
- currencyTypeListGrid.render();
+ var store = new dojo.data.ItemFileWriteStore({data:acqct.initStoreData('code', {identifier:'code'})});
+ currencyTypeListGrid.setStore(store);
+ currencyTypeListGrid.render();
+
+ fieldmapper.standardRequest(
+ [ 'open-ils.acq', 'open-ils.acq.currency_type.all.retrieve'],
+ { async: true,
+ params: [openils.User.authtoken],
+ onresponse : function(r){
+ if(ct = openils.Util.readResponse(r)) {
+ openils.acq.CurrencyType.cache[ct.code()] = ct;
+ store.newItem(acqct.itemToStoreData(ct));
+ }
+ }
}
);
}
More information about the open-ils-commits
mailing list