From: erickson Date: Mon, 17 May 2010 19:57:03 +0000 (+0000) Subject: better handling of mingling readOnly and non-readOnly widgets during copy update... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=8ff1f1fd8dd6bc557e2b6c7b2cbf98215aa932f0;p=evergreen%2Fmasslnc.git better handling of mingling readOnly and non-readOnly widgets during copy update in lineitem table git-svn-id: svn://svn.open-ils.org/ILS/trunk@16443 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/web/js/ui/default/acq/common/li_table.js b/Open-ILS/web/js/ui/default/acq/common/li_table.js index b881630450..4e029af314 100644 --- a/Open-ILS/web/js/ui/default/acq/common/li_table.js +++ b/Open-ILS/web/js/ui/default/acq/common/li_table.js @@ -1437,25 +1437,31 @@ function AcqLiTable() { orgLimitPerms : ['CREATE_PICKLIST', 'CREATE_PURCHASE_ORDER'], readOnly : readOnly, }); + widget.build( // make sure we capture the value from any async widgets function(w, ww) { + if (field == "fund" && w.store) self._ensureCSSFundClasses(w.store); - copy[field](ww.getFormattedValue()) + + if(!readOnly) + copy[field](ww.getFormattedValue()) + self.copyWidgetCache[copy.id()][field] = w; - } - ); - dojo.connect(widget.widget, 'onChange', - function(val) { - if (field == "fund") - self._updateFundSelectorStyle(widget, val); - - if (copy.isnew() || val != copy[field]()) { - // prevent setting ischanged() automatically on widget load for existing copies - copy[field](widget.getFormattedValue()) - copy.ischanged(true); - } + + dojo.connect(w, 'onChange', + function(val) { + if (field == "fund") + self._updateFundSelectorStyle(widget, val); + + if (!readOnly && (copy.isnew() || val != copy[field]())) { + // prevent setting ischanged() automatically on widget load for existing copies + copy[field](widget.getFormattedValue()) + copy.ischanged(true); + } + } + ); } ); }