added optional list of fields whose linked display value should not be fetched
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 17 Aug 2009 16:12:49 +0000 (16:12 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 17 Aug 2009 16:12:49 +0000 (16:12 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@13847 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js
Open-ILS/web/js/dojo/openils/widget/AutoGrid.js

index 569b37e..0b4a242 100644 (file)
@@ -33,6 +33,7 @@ if(!dojo._hasResource['openils.widget.AutoFieldWidget']) {
             if(this.fmObject) 
                 this.fmClass = this.fmObject.classname;
             this.fmIDL = fieldmapper.IDL.fmclasses[this.fmClass];
+            this.suppressLinkedFields = args.suppressLinkedFields || [];
 
             if(!this.idlField) {
                 this.fmIDL = fieldmapper.IDL.fmclasses[this.fmClass];
@@ -200,6 +201,10 @@ if(!dojo._hasResource['openils.widget.AutoFieldWidget']) {
             if(this.idlField.datatype == 'org_unit')
                 return false; // we already handle org_units, no need to re-fetch
 
+            // user opted to bypass fetching this linked data
+            if(this.suppressLinkedFields.indexOf(this.idlField.name) > -1)
+                return false;
+
             var linkInfo = this._getLinkSelector();
             if(!(linkInfo && linkInfo.vfield && linkInfo.vfield.selector)) 
                 return false;
index f903d7a..f57f36a 100644 (file)
@@ -26,6 +26,7 @@ if(!dojo._hasResource['openils.widget.AutoGrid']) {
             displayLimit : 15,
             displayOffset : 0,
             showPaginator : false,
+            suppressLinkedFields : null, // list of fields whose linked display data should not be fetched from the server
 
             /* by default, don't show auto-generated (sequence) fields */
             showSequenceFields : false, 
@@ -538,7 +539,8 @@ if(!dojo._hasResource['openils.widget.AutoGrid']) {
             fmClass: this.grid.fmClass,
             fmField: this.field,
             widgetValue : val,
-            readOnly : true
+            readOnly : true,
+            suppressLinkedFields : this.grid.suppressLinkedFields
         });
 
         var _this = this;