Roo/XComponent.js
authorAlan Knowles <alan@akbkhome.com>
Fri, 10 Jun 2011 03:42:50 +0000 (11:42 +0800)
committerAlan Knowles <alan@akbkhome.com>
Fri, 10 Jun 2011 03:42:50 +0000 (11:42 +0800)
Roo/XComponent.js

index 0d06314..8a1b8b2 100644 (file)
@@ -143,7 +143,7 @@ Roo.apply(Roo.XComponent, {
      * @type {Array} of Roo.XComponent
      */
     
-    modules : [],
+    elmodules : [],
     /**
      * Register components to be built later.
      *
@@ -243,12 +243,13 @@ Roo.apply(Roo.XComponent, {
             return String(a).toUpperCase() > String(b).toUpperCase() ? 1 : -1;
         };
         
-        if (!this.topModule || !this.topModule.modules) {
+        if ((!this.topModule || !this.topModule.modules) && !this.elmodules.length) {
             throw "No top level modules to build";
         }
-       
+        
         // make a flat list in order of modules to build.
-        var mods = [ this.topModule ];
+        var mods = this.topModule ? [ this.topModule ] : [];
+        Roo.each(this.elmodules,function() { mods.push(e) });
         
         
         // add modules to their parents..