Pman.Dialog.BuilderAdd.bjs
authorAlan Knowles <alan@roojs.com>
Tue, 17 Feb 2015 08:18:05 +0000 (16:18 +0800)
committerAlan Knowles <alan@roojs.com>
Tue, 17 Feb 2015 08:18:05 +0000 (16:18 +0800)
Pman.Dialog.BuilderAdd.js

Pman.Dialog.BuilderAdd.bjs
Pman.Dialog.BuilderAdd.js

index 258fc63..82462c9 100644 (file)
@@ -8,8 +8,8 @@
  "items" : [
   {
    "modal" : true,
-   "xtype" : "LayoutDialog",
    "title" : "Add Node",
+   "xtype" : "LayoutDialog",
    "width" : 400,
    "$ xns" : "Roo",
    "closable" : false,
      "items" : [
       {
        "listeners" : {
-        "rendered" : "function (form)\n{\n  _this.form  = form;\n}",
-        "actioncomplete" : "function (_self, action)\n{\n     if (action.type == 'setdata') {\n         // check if element can be templated or databased..\n         \n          \n     }\n}"
+        "actioncomplete" : "function (_self, action)\n{\n     if (action.type == 'setdata') {\n         // check if element can be templated or databased..\n         \n          \n     }\n}",
+        "rendered" : "function (form)\n{\n  _this.form  = form;\n}"
        },
        "xtype" : "Form",
        "$ xns" : "Roo.form",
        "items" : [
         {
-         "legend" : "Do you want to create the element?",
-         "xtype" : "FieldSet",
          "style" : "width:350px",
+         "legend" : "Do you want to create the element ?",
+         "xtype" : "FieldSet",
          "labelWidth" : 140,
          "$ xns" : "Roo.form",
          "items" : [
@@ -68,8 +68,8 @@
              "items" : [
               {
                "$ url" : "baseURL + '/Builder/ERM.php'",
-               "method" : "GET",
                "xtype" : "HttpProxy",
+               "method" : "GET",
                "$ xns" : "Roo.data",
                "* prop" : "proxy"
               },
index 5aab5b9..1a4ffe7 100644 (file)
@@ -30,169 +30,169 @@ Pman.Dialog.BuilderAdd = {
  {
    var _this = this;
    this.dialog = Roo.factory({
-   center : {
+    center : {
+     '|xns' : 'Roo',
+     xtype : 'LayoutRegion',
+     xns : Roo
+    },
     '|xns' : 'Roo',
-    xtype : 'LayoutRegion',
-    xns : Roo
-   },
-   '|xns' : 'Roo',
-   modal : true,
-   xtype : 'LayoutDialog',
-   title : "Add Node",
-   width : 400,
-   xns : Roo,
-   closable : false,
-   resizable : false,
-   height : 170,
-   buttons : [
-     {
-      '|xns' : 'Roo',
-      text : "OK",
-      xtype : 'Button',
-      xns : Roo,
-      listeners : {
-       click : function (_self, e)
-        {
-            var vals = _this.form.getValues();
+    modal : true,
+    title : "Add Node",
+    xtype : 'LayoutDialog',
+    width : 400,
+    xns : Roo,
+    closable : false,
+    resizable : false,
+    height : 170,
+    buttons : [
+      {
+       '|xns' : 'Roo',
+       text : "OK",
+       xtype : 'Button',
+       xns : Roo,
+       listeners : {
+        click : function (_self, e)
+         {
+             var vals = _this.form.getValues();
+             
+             _this.dialog.hide();
+             
+            if (vals.table.length) {
+               Pman.Dialog.BuilderAddTable.show( 
+                Roo.apply({  table : vals.table } , _this.data),  
+                
+                function(data) {
+                     _this.dialog.hide();
+                     var cls = data['|xns'] + '.' + data['xtype'];
+                     
+                     var res = Pman.Builder.Wizard[cls](data);
+                    _this.callback(res); 
+                });
+                 return;
+             }
             
-            _this.dialog.hide();
+             // otherwise, call back with template??
             
-           if (vals.table.length) {
-              Pman.Dialog.BuilderAddTable.show( 
-               Roo.apply({  table : vals.table } , _this.data),  
-               
-               function(data) {
-                    _this.dialog.hide();
-                    var cls = data['|xns'] + '.' + data['xtype'];
-                    
-                    var res = Pman.Builder.Wizard[cls](data);
-                   _this.callback(res); 
-               });
-                return;
-            }
-           
-            // otherwise, call back with template??
-           
-             
-             _this.callback(_this.data);
-        }
-      }
-     },
+              
+              _this.callback(_this.data);
+         }
+       }
+      },
 {
-      '|xns' : 'Roo',
-      text : "Cancel",
-      xtype : 'Button',
-      xns : Roo,
-      listeners : {
-       click : function (_self, e)
-        {
-           _this.dialog.hide();
-        }
-      }
-     }
-   ],
-   items : [
-    {
-     '|xns' : 'Roo',
-     region : 'center',
-     xtype : 'ContentPanel',
-     xns : Roo,
-     items : [
-      {
-       '|xns' : 'Roo.form',
-       xtype : 'Form',
-       xns : Roo.form,
+       '|xns' : 'Roo',
+       text : "Cancel",
+       xtype : 'Button',
+       xns : Roo,
        listeners : {
-        rendered : function (form)
-         {
-           _this.form  = form;
-         },
-        actioncomplete : function (_self, action)
+        click : function (_self, e)
          {
-              if (action.type == 'setdata') {
-                  // check if element can be templated or databased..
-                  
-                   
-              }
+            _this.dialog.hide();
          }
-       },
-       items : [
-        {
-         '|xns' : 'Roo.form',
-         legend : "Do you want to create the element?",
-         xtype : 'FieldSet',
-         style : 'width:350px',
-         labelWidth : 140,
-         xns : Roo.form,
-         items : [
+       }
+      }
+    ],
+    items : [
+     {
+      '|xns' : 'Roo',
+      region : 'center',
+      xtype : 'ContentPanel',
+      xns : Roo,
+      items : [
+       {
+        '|xns' : 'Roo.form',
+        xtype : 'Form',
+        xns : Roo.form,
+        listeners : {
+         actioncomplete : function (_self, action)
           {
-           store : {
-            '|xns' : 'Roo.data',
-            xtype : 'Store',
-            xns : Roo.data
-           },
-           '|xns' : 'Roo.form',
-           fieldLabel : 'From Template',
-           xtype : 'ComboBox',
-           xns : Roo.form,
-           name : 'template',
-           items : [
-
-           ]
-
+               if (action.type == 'setdata') {
+                   // check if element can be templated or databased..
+                   
+                    
+               }
           },
+         rendered : function (form)
           {
-           store : {
-            proxy : {
+            _this.form  = form;
+          }
+        },
+        items : [
+         {
+          '|xns' : 'Roo.form',
+          style : 'width:350px',
+          legend : "Do you want to create the element ?",
+          xtype : 'FieldSet',
+          labelWidth : 140,
+          xns : Roo.form,
+          items : [
+           {
+            store : {
              '|xns' : 'Roo.data',
-             url : baseURL + '/Builder/ERM.php',
-             method : 'GET',
-             xtype : 'HttpProxy',
+             xtype : 'Store',
              xns : Roo.data
             },
-            reader : {
+            '|xns' : 'Roo.form',
+            fieldLabel : 'From Template',
+            xtype : 'ComboBox',
+            xns : Roo.form,
+            name : 'template',
+            items : [
+
+            ]
+
+           },
+           {
+            store : {
+             proxy : {
+              '|xns' : 'Roo.data',
+              url : baseURL + '/Builder/ERM.php',
+              xtype : 'HttpProxy',
+              method : 'GET',
+              xns : Roo.data
+             },
+             reader : {
+              '|xns' : 'Roo.data',
+              root : 'data',
+              xtype : 'JsonReader',
+              fields : [  'name' , 'desc' ],
+              xns : Roo.data,
+              totalProperty : 'total'
+             },
              '|xns' : 'Roo.data',
-             root : 'data',
-             xtype : 'JsonReader',
-             fields : [  'name' , 'desc' ],
+             xtype : 'Store',
              xns : Roo.data,
-             totalProperty : 'total'
+             items : [
+
+             ]
+
             },
-            '|xns' : 'Roo.data',
-            xtype : 'Store',
-            xns : Roo.data,
+            '|xns' : 'Roo.form',
+            alwaysQuery : true,
+            listWidth : 400,
+            triggerAction : 'all',
+            fieldLabel : 'From Database Table',
+            displayField : 'name',
+            xtype : 'ComboBox',
+            allowBlank : true,
+            xns : Roo.form,
+            name : 'table',
+            tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> {desc}</div>',
             items : [
 
             ]
 
-           },
-           '|xns' : 'Roo.form',
-           alwaysQuery : true,
-           listWidth : 400,
-           triggerAction : 'all',
-           fieldLabel : 'From Database Table',
-           displayField : 'name',
-           xtype : 'ComboBox',
-           allowBlank : true,
-           xns : Roo.form,
-           name : 'table',
-           tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> {desc}</div>',
-           items : [
-
-           ]
+           }
+          ]
 
-          }
-         ]
+         }
+        ]
 
-        }
-       ]
+       }
+      ]
 
-      }
-     ]
-
-    }
-   ]
+     }
+    ]
 
-  });
+   });
  }
 };