Pman.Dialog.BuilderAdd.bjs
[Pman.Builder] / Pman.Dialog.BuilderAdd.bjs
1 {
2     "name" : "Pman.Dialog.BuilderAdd",
3     "parent" : "",
4     "title" : "Pman.Dialog.BuilderAdd",
5     "path" : "/home/alan/gitlive/Pman.Builder/Pman.Dialog.BuilderAdd.bjs",
6     "permname" : "",
7     "modOrder" : "001",
8     "items" : [
9         {
10             "modal" : true,
11             "title" : "Add Node",
12             "xtype" : "LayoutDialog",
13             "width" : 400,
14             "$ xns" : "Roo",
15             "closable" : false,
16             "resizable" : false,
17             "height" : 170,
18             "items" : [
19                 {
20                     "region" : "center",
21                     "xtype" : "ContentPanel",
22                     "$ xns" : "Roo",
23                     "items" : [
24                         {
25                             "listeners" : {
26                                 "actioncomplete" : "function (_self, action)\n{\n     if (action.type == 'setdata') {\n         // check if element can be templated or databased..\n         \n          \n     }\n}",
27                                 "rendered" : "function (form)\n{\n  _this.form  = form;\n}"
28                             },
29                             "xtype" : "Form",
30                             "$ xns" : "Roo.form",
31                             "items" : [
32                                 {
33                                     "style" : "width:350px",
34                                     "legend" : "Do you want to create the element : ",
35                                     "xtype" : "FieldSet",
36                                     "labelWidth" : 140,
37                                     "$ xns" : "Roo.form",
38                                     "items" : [
39                                         {
40                                             "fieldLabel" : "From Template",
41                                             "xtype" : "ComboBox",
42                                             "$ xns" : "Roo.form",
43                                             "name" : "template",
44                                             "items" : [
45                                                 {
46                                                     "xtype" : "Store",
47                                                     "$ xns" : "Roo.data",
48                                                     "* prop" : "store"
49                                                 }
50                                             ]
51                                         },
52                                         {
53                                             "alwaysQuery" : true,
54                                             "listWidth" : 400,
55                                             "triggerAction" : "all",
56                                             "fieldLabel" : "From Database Table",
57                                             "displayField" : "name",
58                                             "xtype" : "ComboBox",
59                                             "allowBlank" : true,
60                                             "$ xns" : "Roo.form",
61                                             "name" : "table",
62                                             "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> {desc}</div>",
63                                             "items" : [
64                                                 {
65                                                     "xtype" : "Store",
66                                                     "$ xns" : "Roo.data",
67                                                     "* prop" : "store",
68                                                     "items" : [
69                                                         {
70                                                             "$ url" : "baseURL + '/Builder/ERM.php'",
71                                                             "xtype" : "HttpProxy",
72                                                             "method" : "GET",
73                                                             "$ xns" : "Roo.data",
74                                                             "* prop" : "proxy"
75                                                         },
76                                                         {
77                                                             "root" : "data",
78                                                             "xtype" : "JsonReader",
79                                                             "$ fields" : "[  'name' , 'desc' ]\n  ",
80                                                             "$ xns" : "Roo.data",
81                                                             "* prop" : "reader",
82                                                             "totalProperty" : "total"
83                                                         }
84                                                     ]
85                                                 }
86                                             ]
87                                         }
88                                     ]
89                                 }
90                             ]
91                         }
92                     ]
93                 },
94                 {
95                     "xtype" : "LayoutRegion",
96                     "$ xns" : "Roo",
97                     "* prop" : "center"
98                 },
99                 {
100                     "listeners" : {
101                         "click" : "function (_self, e)\n{\n    var vals = _this.form.getValues();\n    \n    _this.dialog.hide();\n    \n   if (vals.table.length) {\n      Pman.Dialog.BuilderAddTable.show( \n       Roo.apply({  table : vals.table } , _this.data),  \n       \n       function(data) {\n            _this.dialog.hide();\n            var cls = data['|xns'] + '.' + data['xtype'];\n            \n            var res = Pman.Builder.Wizard[cls](data);\n           _this.callback(res); \n       });\n        return;\n    }\n   \n    // otherwise, call back with template??\n   \n     \n     _this.callback(_this.data);\n}"
102                     },
103                     "text" : "OK",
104                     "xtype" : "Button",
105                     "$ xns" : "Roo",
106                     "* prop" : "buttons[]"
107                 },
108                 {
109                     "listeners" : {
110                         "click" : "function (_self, e)\n{\n   _this.dialog.hide();\n}"
111                     },
112                     "text" : "Cancel",
113                     "xtype" : "Button",
114                     "$ xns" : "Roo",
115                     "* prop" : "buttons[]"
116                 }
117             ]
118         }
119     ]
120 }