builder.html.js
[app.Builder.js] / builder.html.js
index 837e80f..f07d3de 100644 (file)
@@ -1,5 +1,6 @@
 //<script type="text/javascript">
 
+_this = { } ; // a fake self for rendering.
 
 Builder  = {
     
@@ -82,7 +83,7 @@ Builder  = {
         
         
         this.munge(cfg);
-        console.log(this.dump(cfg)); 
+        //console.log(this.dump(cfg)); 
         // we draw either a dialog or a tab..
         
         if (cfg.xtype == 'LayoutDialog') {
@@ -164,6 +165,7 @@ Builder  = {
         
         for(var p in cfg){
             // key is not string?!?!?!!?
+            console.log(p);
             if (typeof(p) != 'string') {
                 continue;
             }
@@ -188,9 +190,9 @@ Builder  = {
                     // stupid IE can not return objects evaluated..
                     eval('_tmp =(' + cfg[p] + ')');
                     cfg[p.substr(1)] = _tmp;
-                    //if (typeof(_tmp) == 'undefined') {
-                    //    alert(cfg[p]);
-                   // }
+                    if (typeof(_tmp) == 'undefined') {
+                        alert(cfg[p]);
+                    }
                    
                 } catch(e) {  
                     console.log('Error evaluating: '  + cfg[p] + "\r\n" + JSON.stringify(e)); 
@@ -221,8 +223,8 @@ Builder  = {
              
         }
         if (cfg.xtype) {
-            if (typeof(cfg.xns[cfg.xtype]) == 'undefined') {
-                throw "Invalid Xtype " + this.xtreepath;
+            if (!cfg.xns || typeof(cfg.xns[cfg.xtype]) == 'undefined') {
+                throw "Invalid Xtype " + cfg.xtype + ' on ' + cfg.xtreepath;
             }
         }