From: erickson Date: Mon, 21 Apr 2008 18:47:16 +0000 (+0000) Subject: added general function to flesh a select widget with the full set of currency types X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=5328a549f08085088fa5d266064db13d7f262634;p=Evergreen.git added general function to flesh a select widget with the full set of currency types git-svn-id: svn://svn.open-ils.org/ILS/branches/acq-experiment@9410 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/web/js/dojo/openils/acq/CurrencyType.js b/Open-ILS/web/js/dojo/openils/acq/CurrencyType.js index c041b3e6c6..62451fde68 100644 --- a/Open-ILS/web/js/dojo/openils/acq/CurrencyType.js +++ b/Open-ILS/web/js/dojo/openils/acq/CurrencyType.js @@ -18,6 +18,8 @@ if(!dojo._hasResource["openils.acq.CurrencyType"]) { dojo._hasResource["openils.acq.CurrencyType"] = true; dojo.provide("openils.acq.CurrencyType"); + dojo.require('openils.User'); + dojo.declare('openils.acq.CurrencyType', null, { }); @@ -39,5 +41,15 @@ if(!dojo._hasResource["openils.acq.CurrencyType"]) { } req.send(); } + + openils.acq.CurrencyType.loadSelectWidget = function(selector) { + openils.acq.CurrencyType.fetchAll( + function(ctypes) { + selector.store = new dojo.data.ItemFileReadStore( + {data:acqct.toStoreData(ctypes, 'code', {identifier:'code'})}); + selector.setValue(ctypes[0].code()); /* XXX get from setting */ + } + ); + } }