[open-ils-commits] r12339 - trunk/Open-ILS/web/js/dojo/openils/widget (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Sun Mar 1 20:23:00 EST 2009


Author: erickson
Date: 2009-03-01 20:22:59 -0500 (Sun, 01 Mar 2009)
New Revision: 12339

Modified:
   trunk/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js
   trunk/Open-ILS/web/js/dojo/openils/widget/EditPane.js
Log:
can now pass in override widget types to grid and edit pane

Modified: trunk/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js
===================================================================
--- trunk/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js	2009-03-02 01:22:20 UTC (rev 12338)
+++ trunk/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js	2009-03-02 01:22:59 UTC (rev 12339)
@@ -16,6 +16,7 @@
             editOnEnter : false, 
             defaultCellWidth : null,
             editStyle : 'dialog',
+            suppressFields : null,
 
             /* by default, don't show auto-generated (sequence) fields */
             showSequenceFields : false, 
@@ -27,6 +28,7 @@
                 this.setStructure(this._compileStructure());
                 this.setStore(this.buildAutoStore());
                 this.overrideEditWidgets = {};
+                this.overrideEditWidgetClass = {};
                 if(this.editOnEnter) 
                     this._applyEditOnEnter();
                 else if(this.singleEditStyle) 
@@ -40,6 +42,10 @@
 
                 var self = this;
                 function pushEntry(entry) {
+                    if(self.suppressFields) {
+                        if(dojo.indexOf(self.suppressFields, entry.field) != -1)
+                            return;
+                    }
                     if(!entry.get) 
                         entry.get = openils.widget.AutoGrid.defaultGetter
                     if(!entry.width && self.defaultCellWidth)
@@ -122,6 +128,7 @@
                 var pane = new openils.widget.EditPane({
                     fmObject:fmObject,
                     overrideWidgets : this.overrideEditWidgets,
+                    overrideWidgetClass : this.overrideEditWidgetClass,
                     onPostSubmit : function() {
                         for(var i in fmObject._fields) {
                             var field = fmObject._fields[i];
@@ -157,6 +164,7 @@
                 var pane = new openils.widget.EditPane({
                     fmClass : this.fmClass,
                     overrideWidgets : this.overrideEditWidgets,
+                    overrideWidgetClass : this.overrideEditWidgetClass,
                     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-03-02 01:22:20 UTC (rev 12338)
+++ trunk/Open-ILS/web/js/dojo/openils/widget/EditPane.js	2009-03-02 01:22:59 UTC (rev 12339)
@@ -44,6 +44,9 @@
                 if(!this.overrideWidgets)
                     this.overrideWidgets = {};
 
+                if(!this.overrideWidgetClass)
+                    this.overrideWidgetClass = {};
+
                 for(var f in this.sortedFieldList) {
                     var field = this.sortedFieldList[f];
                     if(!field || field.virtual) continue;
@@ -71,7 +74,8 @@
                         parentNode : valSpan,
                         orgLimitPerms : this.limitPerms,
                         readOnly : this.readOnly,
-                        widget : this.overrideWidgets[field.name]
+                        widget : this.overrideWidgets[field.name],
+                        widgetClass : this.overrideWidgetClass[field.name]
                     });
 
                     widget.build();



More information about the open-ils-commits mailing list