Pman.Dialog.BuilderPart.bjs
[Pman.Builder] / Pman.Dialog.BuilderPart.bjs
1 {
2     "id": "roo-file-44",
3     "name": "Pman.Dialog.BuilderPart",
4     "parent": "",
5     "title": "",
6     "path": "/home/alan/gitlive/Pman.Builder/Pman.Dialog.BuilderPart.bjs",
7     "items": [
8         {
9             "closable": false,
10             "collapsible": false,
11             "height": 140,
12             "resizable": false,
13             "title": "Edit / Create builder_part",
14             "width": 450,
15             "xtype": "LayoutDialog",
16             "|xns": "Roo",
17             "items": [
18                 {
19                     "|xns": "Roo",
20                     "xtype": "LayoutRegion",
21                     "*prop": "center"
22                 },
23                 {
24                     "region": "center",
25                     "xtype": "ContentPanel",
26                     "|xns": "Roo",
27                     "items": [
28                         {
29                             "listeners": {
30                                 "|actioncomplete": "function(_self,action)\n{\n    if (action.type == 'setdata') {\n        if (!_this.data.id) {   \n            this.load({ method: 'GET', params: { '_id' : _this.data.id }});\n            return;\n        }\n       return;\n    }\n    if (action.type == 'load') {\n         \n        return;\n    }\n    if (action.type =='submit') {\n     \n        _this.dialog.hide();\n    \n         if (_this.callback) {\n            _this.callback.call(_this, _this.form.getValues());\n         }\n         _this.form.reset();\n         return;\n    }\n}\n",
31                                 "|rendered": "function (form)\n{\n    _this.form= form;\n}\n"
32                             },
33                             "method": "POST",
34                             "style": "margin:10px;",
35                             "xtype": "Form",
36                             "|url": "baseURL + '/Roo/builder_part.php'",
37                             "|xns": "Roo.form",
38                             "items": [
39                                 {
40                                     "|xns": "Roo.form",
41                                     "xtype": "ComboBox",
42                                     "allowBlank": "false",
43                                     "editable": "false",
44                                     "emptyText": "Select builder_modules",
45                                     "forceSelection": true,
46                                     "listWidth": 400,
47                                     "loadingText": "Searching...",
48                                     "minChars": 2,
49                                     "pageSize": 20,
50                                     "qtip": "Select builder_modules",
51                                     "selectOnFocus": true,
52                                     "triggerAction": "all",
53                                     "typeAhead": true,
54                                     "width": 300,
55                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> </div>",
56                                     "queryParam": "query[name]",
57                                     "fieldLabel": "Module",
58                                     "valueField": "id",
59                                     "displayField": "name",
60                                     "hiddenName": "module_id",
61                                     "name": "module_id_name",
62                                     "items": [
63                                         {
64                                             "*prop": "store",
65                                             "xtype": "Store",
66                                             "|xns": "Roo.data",
67                                             "remoteSort": true,
68                                             "|sortInfo": "{ direction : 'ASC', field: 'id' }",
69                                             "listeners": {
70                                                 "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n}\n"
71                                             },
72                                             "items": [
73                                                 {
74                                                     "*prop": "proxy",
75                                                     "xtype": "HttpProxy",
76                                                     "method": "GET",
77                                                     "|xns": "Roo.data",
78                                                     "|url": "baseURL + '/Roo/builder_modules.php'"
79                                                 },
80                                                 {
81                                                     "*prop": "reader",
82                                                     "xtype": "JsonReader",
83                                                     "|xns": "Roo.data",
84                                                     "id": "id",
85                                                     "root": "data",
86                                                     "totalProperty": "total",
87                                                     "|fields": "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"name\",\"type\":\"string\"}]"
88                                                 }
89                                             ]
90                                         }
91                                     ]
92                                 },
93                                 {
94                                     "fieldLabel": "Part name",
95                                     "name": "name",
96                                     "width": 300,
97                                     "xtype": "TextField",
98                                     "|xns": "Roo.form"
99                                 },
100                                 {
101                                     "name": "id",
102                                     "|xns": "Roo.form",
103                                     "xtype": "Hidden"
104                                 }
105                             ]
106                         }
107                     ]
108                 },
109                 {
110                     "listeners": {
111                         "click": "function (_self, e)\n{\n    _this.dialog.hide();\n}"
112                     },
113                     "*prop": "buttons[]",
114                     "text": "Cancel",
115                     "xtype": "Button",
116                     "|xns": "Roo"
117                 },
118                 {
119                     "listeners": {
120                         "click": "function (_self, e)\n{\n    // do some checks?\n     \n     \n    _this.form.doAction(\"submit\");\n\n}"
121                     },
122                     "*prop": "buttons[]",
123                     "text": "Save",
124                     "xtype": "Button",
125                     "|xns": "Roo"
126                 }
127             ]
128         }
129     ],
130     "permname": "",
131     "modOrder": "001"
132 }