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

svn at svn.open-ils.org svn at svn.open-ils.org
Mon May 11 15:18:47 EDT 2009


Author: erickson
Date: 2009-05-11 15:18:44 -0400 (Mon, 11 May 2009)
New Revision: 13129

Modified:
   trunk/Open-ILS/web/js/dojo/openils/widget/AutoWidget.js
Log:
honor non-IDL fields in the fieldOrder

Modified: trunk/Open-ILS/web/js/dojo/openils/widget/AutoWidget.js
===================================================================
--- trunk/Open-ILS/web/js/dojo/openils/widget/AutoWidget.js	2009-05-11 18:05:52 UTC (rev 13128)
+++ trunk/Open-ILS/web/js/dojo/openils/widget/AutoWidget.js	2009-05-11 19:18:44 UTC (rev 13129)
@@ -40,16 +40,19 @@
 
             if(this.fieldOrder) {
 
-                for(var idx in this.fieldOrder) {
-                    var name = this.fieldOrder[idx];
-                    for(var idx2 in this.fmIDL.fields) {
-                        if(this.fmIDL.fields[idx2].name == name) {
-                            this.sortedFieldList.push(this.fmIDL.fields[idx2]);
-                            break;
+                var self = this;
+                dojo.forEach(this.fieldOrder,
+                    function(name) {
+                        var field = self.fmIDL.fields.filter(function(item) { return (item.name == name) } )[0];
+                        if(field) {
+                            self.sortedFieldList.push(field)
+                        } else {
+                            // non-IDL field
+                            self.sortedFieldList.push({name : name});
                         }
                     }
-                }
-                
+                );
+
                 // if the user-defined order does not list all fields, 
                 // shove the extras on the end.
                 var anonFields = [];



More information about the open-ils-commits mailing list