builder.html.js
[app.Builder.js] / builder.html.js
index e757189..b4e31dd 100644 (file)
@@ -43,17 +43,29 @@ Builder  = {
         }
         if (this.layoutbase) {
             //console.log(Builder.dump(this.layoutbase.el));
+            
+            
             try {
-                this.layoutbase.remove('center', this.layoutbase.getRegion('center'));
+                var pan = this.layoutbase.getRegion('center').getPanel(0);
+                if (pan) {
+                    this.layoutbase.remove('center', pan);
+                }
+                
+                
             } catch( e) {
+                console.log(e);
                 // reload!!?
             }
-            this.layoutbase= false;
+            
+            
+            
+            //this.layoutbase= false;
         }
          
         
     },
     
+    
     redraw: function(isAuto)
     {
         
@@ -69,7 +81,7 @@ Builder  = {
         
         
         this.munge(cfg);
-        print(cfg);return;
+        //console.log(cfg);return;
         // we draw either a dialog or a tab..
         
         if (cfg.xtype == 'LayoutDialog') {
@@ -312,14 +324,18 @@ Builder  = {
             return true;
         }
         // needs fixing..
-        console.log(ftg.dom.className);
-        var cmat = ftg.dom.className.match(/x-grid-hd-builder-(form-gen-[0-9:]+)/);
-        
-        if (cmat) {
-            this[method]( cmat[1] );
-            return true;
+        if (ftg.dom.className.match(/[0-9]+/)) {
+            console.log(ftg.dom.className);
+            var cmat = ftg.dom.className.match(/x-grid-hd-builder-(form-gen-[0-9:]+)/);
+            if (cmat) {
+                this[method]( cmat[1] );
+                return true;
+            }
         }
         
+        
+        
+        
         return false;
     },