Roo/bootstrap/layout/Border.js
[roojs1] / Roo / bootstrap / layout / Border.js
index dc918ae..c3633d8 100644 (file)
@@ -41,19 +41,6 @@ Roo.bootstrap.layout.Border = function(config){
 Roo.bootstrap.layout.Border.regions =  ["north","south","east","west","center"];
 
 Roo.extend(Roo.bootstrap.layout.Border, Roo.bootstrap.layout.Manager, {
-    
-    onRender : function(ctr, pos)
-    {
-        Roo.each(Roo.bootstrap.layout.Border.regions, function(region) {
-            if(this.regions[region]){
-                this.regions[region].onRender(this.el, pos);
-            }
-        },this);
-        
-        
-    },
-    
-    
     /**
      * Creates and adds a new region if it doesn't already exist.
      * @param {String} target The target region key (north, south, east, west or center).
@@ -90,6 +77,14 @@ Roo.extend(Roo.bootstrap.layout.Border, Roo.bootstrap.layout.Manager, {
         if(this.updating) {
             return;
         }
+        
+        // render all the rebions if they have not been done alreayd?
+        Roo.each(Roo.bootstrap.layout.Border.regions, function(region) {
+            if(this.regions[region] && !this.regions[region].bodyEl){
+                this.regions[region].onRender(this.el)
+            }
+        },this);
+        
         var size = this.getViewSize();
         var w = size.width;
         var h = size.height;
@@ -300,13 +295,18 @@ layout.addxtype({
             delete cfg.items;
         }
         var nb = false;
+       
+       if (cfg.region == 'center') {
+           Roo.log(cfg.title);
+       }
+       
         
         switch(cfg.xtype) 
         {
             case 'Content':  // ContentPanel (el, cfg)
             case 'Scroll':  // ContentPanel (el, cfg)
             case 'View': 
-                cfg.autoCreate = true;
+                cfg.autoCreate = cfg.autoCreate || true;
                 ret = new cfg.xns[cfg.xtype](cfg); // new panel!!!!!
                 //} else {
                 //    var el = this.el.createChild();
@@ -354,12 +354,12 @@ layout.addxtype({
                 // needs grid and region
                 
                 //var el = this.getRegion(region).el.createChild();
-                var el = this.el.createChild();
+                /*
+                 *var el = this.el.createChild();
                 // create the grid first...
                 cfg.grid.container = el;
-                cfg.grid.scrollBody = true;
                 cfg.grid = new cfg.grid.xns[cfg.grid.xtype](cfg.grid);
-                
+                */
                 
                 if (region == 'center' && this.active ) {
                     cfg.background = false;
@@ -368,17 +368,18 @@ layout.addxtype({
                 ret = new cfg.xns[cfg.xtype](cfg); // new panel!!!!!
                 
                 this.add(region, ret);
-                
+                /*
                 if (cfg.background) {
                     // render grid on panel activation (if panel background)
                     ret.on('activate', function(gp) {
                         if (!gp.grid.rendered) {
-                            gp.grid.render(gp.grid.getGridEl());
+                    //        gp.grid.render(el);
                         }
                     });
                 } else {
-                    cfg.grid.render(cfg.grid.getGridEl());
+                  //  cfg.grid.render(el);
                 }
+                */
                 break;