[open-ils-commits] r12763 - trunk/Open-ILS/web/js/dojo/openils/widget (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Apr 2 11:35:34 EDT 2009
Author: erickson
Date: 2009-04-02 11:35:30 -0400 (Thu, 02 Apr 2009)
New Revision: 12763
Modified:
trunk/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js
trunk/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js
trunk/Open-ILS/web/js/dojo/openils/widget/EditPane.js
Log:
allow the caller to define a function that tells the autofield widget to disable itself if it returns true
Modified: trunk/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js
===================================================================
--- trunk/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js 2009-04-02 03:36:35 UTC (rev 12762)
+++ trunk/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js 2009-04-02 15:35:30 UTC (rev 12763)
@@ -302,6 +302,8 @@
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);
Modified: trunk/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js
===================================================================
--- trunk/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js 2009-04-02 03:36:35 UTC (rev 12762)
+++ trunk/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js 2009-04-02 15:35:30 UTC (rev 12763)
@@ -140,6 +140,7 @@
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 @@
fmClass : this.fmClass,
overrideWidgets : this.overrideEditWidgets,
overrideWidgetClass : this.overrideEditWidgetClass,
+ disableWidgetTest : this.disableWidgetTest,
onPostSubmit : function(r) {
var fmObject = openils.Util.readResponse(r);
if(fmObject)
Modified: trunk/Open-ILS/web/js/dojo/openils/widget/EditPane.js
===================================================================
--- trunk/Open-ILS/web/js/dojo/openils/widget/EditPane.js 2009-04-02 03:36:35 UTC (rev 12762)
+++ trunk/Open-ILS/web/js/dojo/openils/widget/EditPane.js 2009-04-02 15:35:30 UTC (rev 12763)
@@ -75,7 +75,8 @@
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();
More information about the open-ils-commits
mailing list