builder.html.js
[app.Builder.js] / builder.html.js
index 46165c4..0ba005f 100644 (file)
@@ -40,7 +40,10 @@ Builder  = {
             this.dialogroot.remove();
             this.dialogroot = false;
         }
-        
+        if (this.layoutbase) {
+            this.layoutbase.remove();
+            this.layoutbase= false;
+        }
          
         
     },
@@ -82,27 +85,30 @@ Builder  = {
             
         }
         
-        return
-     /*
-        // force center region..
-        cfg.items[0].region = 'center';
-        cfg.items[0].background = false;
-        
-        this.panelroot = this.layout.addxtype(cfg.items[0]);
+        // otherwise we are creating a layout area on the document..
         
          
-        this.highlightElement(Pman.Tab.BuilderTree.currentNode);
-        
-        if (this.panelroot.el) {
-                
-                this.panelroot.el.scrollTo('top', this.scroll.top);
-                this.panelroot.el.scrollTo('left', this.scroll.left);
-            
-        }
-        
-        */
-        
-        
+        // handles 
+        // contentpanel, nestedlayoutpanel, contentpanel.. etc. 
+        // force center region..
+        cfg.region = 'center';
+        cfg.background = false;
+        this.layoutbase = new Ext.BorderLayout(document.body, {
+          
+             center: {
+                titlebar: false,
+                autoScroll:false,
+                closeOnTab: true,
+                tabPosition: 'top',
+                //resizeTabs: true,
+                alwaysShowTabs: true,
+                minTabWidth: 140
+            }
+        });
+        var layoutroot = Roo.get( document.body).createChild({
+                id : cfg.id
+        });
+        this.layoutbase.add( 'center', new Roo[cfg.xtype](layoutroot , cfg)); 
         
         
         
@@ -206,6 +212,13 @@ Builder  = {
                 var pr = xi['*prop'];
                 this.munge(xi);
                 // if prop is an array - then it's items are really the value..
+                if (pr.match(/\[\]$/)) {
+                    pr = pr.replace(/\[\]$/, '');
+                    cfg[pr] = cfg[pr]  || [];
+                    cfg[pr].push(xi);
+                    continue;
+                }
+                
                 
                 if (xi.xtype && xi.xtype  == 'Array') {
                     cfg[pr] = xi.items;
@@ -273,7 +286,7 @@ Builder  = {
       // console.log(ftg.id);
         if (ftg.id && typeof(ftg.id) == 'string' && ftg.id.match(/builder-/)) {
             var nid = ftg.id.replace('builder-', '').replace('x-form-el-', '');
-            this.logMove( nid );
+            this[method]( nid );
             return true;
         }
         // needs fixing..