From b9968b0b9e32f60ab0591372c680161540a5bacb Mon Sep 17 00:00:00 2001 From: erickson Date: Fri, 4 Sep 2009 19:58:38 +0000 Subject: [PATCH] plug baseWidgetValue setting for readOnly widgets back in with try/catch and comment. typo: state -> state() git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_6@13967 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js | 16 +++++++++++++++- Open-ILS/web/js/ui/default/acq/common/li_table.js | 2 +- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js b/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js index 10f6a99a58..2d40f7144f 100644 --- a/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js +++ b/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js @@ -338,7 +338,21 @@ if(!dojo._hasResource['openils.widget.AutoFieldWidget']) { * For widgets that run asynchronously, provide a callback for finishing up */ _widgetLoaded : function(value) { - if(!this.readOnly) { + + if(this.readOnly) { + + /* ------------------------------------------------------------- + when using widgets in a grid, the cell may dissapear, which + kills the underlying DOM node, which causes this to fail. + For now, back out gracefully and let grid getters use + getDisplayString() instead + -------------------------------------------------------------*/ + try { + this.baseWidgetValue(this.getDisplayString()); + } catch (E) {}; + + } else { + this.baseWidgetValue(this.widgetValue); if(this.idlField.name == this.fmIDL.pkey && this.fmIDL.pkey_sequence) this.widget.attr('disabled', true); 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 d77af1274c..cacd808ec2 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 @@ -198,7 +198,7 @@ function AcqLiTable() { var recv_link = dojo.query('[name=receive_link]', row)[0]; - if(li.state == 'on-order') { + if(li.state() == 'on-order') { recv_link.onclick = function() { self.receiveLi(li); openils.Util.hide(recv_link) -- 2.11.0