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