From: erickson Date: Thu, 2 Apr 2009 15:35:30 +0000 (+0000) Subject: allow the caller to define a function that tells the autofield widget to disable... X-Git-Tag: sprint4-merge-nov22~10346 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=aa1d61fa1248efd60402573f09c18293c03b3eb9;p=working%2FEvergreen.git allow the caller to define a function that tells the autofield widget to disable itself if it returns true git-svn-id: svn://svn.open-ils.org/ILS/trunk@12763 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js b/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js index db630d8cc1..648ec93b20 100644 --- a/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js +++ b/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js @@ -302,6 +302,8 @@ if(!dojo._hasResource['openils.widget.AutoFieldWidget']) { this.baseWidgetValue(this.widgetValue); if(this.idlField.name == this.fmIDL.pkey && this.fmIDL.pkey_sequence) this.widget.attr('disabled', true); + if(this.disableWidgetTest && this.disableWidgetTest(this.idlField.name, this.fmObject)) + this.widget.attr('disabled', true); } if(this.onload) this.onload(this.widget, this); diff --git a/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js b/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js index 060a67ef8c..6c1b2968a1 100644 --- a/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js +++ b/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js @@ -140,6 +140,7 @@ if(!dojo._hasResource['openils.widget.AutoGrid']) { fmObject:fmObject, overrideWidgets : this.overrideEditWidgets, overrideWidgetClass : this.overrideEditWidgetClass, + disableWidgetTest : this.disableWidgetTest, onPostSubmit : function() { for(var i in fmObject._fields) { var field = fmObject._fields[i]; @@ -176,6 +177,7 @@ if(!dojo._hasResource['openils.widget.AutoGrid']) { fmClass : this.fmClass, overrideWidgets : this.overrideEditWidgets, overrideWidgetClass : this.overrideEditWidgetClass, + disableWidgetTest : this.disableWidgetTest, onPostSubmit : function(r) { var fmObject = openils.Util.readResponse(r); if(fmObject) diff --git a/Open-ILS/web/js/dojo/openils/widget/EditPane.js b/Open-ILS/web/js/dojo/openils/widget/EditPane.js index 9bdfbf6e92..2093e88001 100644 --- a/Open-ILS/web/js/dojo/openils/widget/EditPane.js +++ b/Open-ILS/web/js/dojo/openils/widget/EditPane.js @@ -75,7 +75,8 @@ if(!dojo._hasResource['openils.widget.EditPane']) { orgLimitPerms : this.limitPerms, readOnly : this.readOnly, widget : this.overrideWidgets[field.name], - widgetClass : this.overrideWidgetClass[field.name] + widgetClass : this.overrideWidgetClass[field.name], + disableWidgetTest : this.disableWidgetTest }); widget.build();