Pman.Dialog.CoreEnum.bjs
[Pman.Core] / Pman.Dialog.CoreEnum.bjs
1 {
2     "id": "roo-file-206",
3     "name": "Pman.Dialog.CoreEnum",
4     "parent": "",
5     "title": "",
6     "path": "/home/edward/gitlive/Pman.Core/Pman.Dialog.CoreEnum.bjs",
7     "items": [
8         {
9             "listeners": {
10                 "show": "function (_self)\n{\n    \n}"
11             },
12             "background": true,
13             "closable": false,
14             "collapsible": false,
15             "height": 150,
16             "modal": true,
17             "resizable": false,
18             "title": "Add / Edit Core Enum",
19             "width": 400,
20             "xtype": "LayoutDialog",
21             "|xns": "Roo",
22             "items": [
23                 {
24                     "xtype": "LayoutRegion",
25                     "*prop": "center",
26                     "titlebar": false,
27                     "|xns": "Roo"
28                 },
29                 {
30                     "xtype": "ContentPanel",
31                     "background": true,
32                     "fitToFrame": true,
33                     "region": "center",
34                     "listeners": {},
35                     "|xns": "Roo",
36                     "items": [
37                         {
38                             "listeners": {
39                                 "|actioncomplete": "function (_self, action)\n{\n  if (action.type == 'setdata') {\n\n        if((typeof(_this.data.etype) == 'undefined') || !_this.data.etype.length){\n            Roo.MessageBox.alert('Error', 'Missing etype');\n            _this.dialog.hide();\n            return;\n        }\n  \n        if(_this.data.id){\n            _this.dialog.el.mask(\"Loading\");\n            this.load({ method: 'GET', params: { '_id' : _this.data.id }}); \n        }\n       \n       return;\n    }\n    if (action.type == 'load') {\n        _this.dialog.el.unmask();\n        return;\n    }\n    if (action.type == 'submit' ) {\n        _this.dialog.el.unmask();\n        _this.dialog.hide();\n\n        if (_this.callback) {\n           _this.callback.call(_this, action.result.data);\n        }\n        _this.form.reset();\n    }\n}\n",
40                                 "|rendered": "function (form)\n{\n   _this.form = form;\n}"
41                             },
42                             "method": "POST",
43                             "style": "margin: 5px",
44                             "xtype": "Form",
45                             "|url": "baseURL + '/Roo/core_enum.php'",
46                             "|xns": "Roo.form",
47                             "items": [
48                                 {
49                                     "actionMode": "fieldEl",
50                                     "allowBlank": false,
51                                     "fieldLabel": "Name",
52                                     "hidden": true,
53                                     "name": "name",
54                                     "width": 200,
55                                     "xtype": "TextField",
56                                     "|xns": "Roo.form"
57                                 },
58                                 {
59                                     "allowBlank": false,
60                                     "fieldLabel": "Display Name",
61                                     "name": "display_name",
62                                     "width": 200,
63                                     "xtype": "TextField",
64                                     "|xns": "Roo.form"
65                                 },
66                                 {
67                                     "fieldLabel": "Active",
68                                     "inputValue": 1,
69                                     "name": "active",
70                                     "value": 0,
71                                     "valueOff": 0,
72                                     "xtype": "Checkbox",
73                                     "|xns": "Roo.form"
74                                 },
75                                 {
76                                     "name": "etype",
77                                     "xtype": "Hidden",
78                                     "|xns": "Roo.form"
79                                 },
80                                 {
81                                     "name": "seqid",
82                                     "value": 0,
83                                     "xtype": "Hidden",
84                                     "|xns": "Roo.form"
85                                 },
86                                 {
87                                     "name": "id",
88                                     "xtype": "Hidden",
89                                     "|xns": "Roo.form"
90                                 }
91                             ]
92                         }
93                     ]
94                 },
95                 {
96                     "listeners": {
97                         "|click": "function() {\n    _this.form.reset();\n    _this.dialog.hide();\n}"
98                     },
99                     "*prop": "buttons[]",
100                     "text": "Cancel",
101                     "xtype": "Button",
102                     "|xns": "Roo"
103                 },
104                 {
105                     "listeners": {
106                         "|click": "function() {\n\n    var name =     _this.form.findField('name').getValue();\n    name = name.toUpperCase().replace(/[^A-Z]+/g, '');\n    if (!name.length) {\n        Roo.MessageBox.alert(\"Error\",\"Please fill in a valid name\");\n        return;\n    }\n    _this.form.findField('name').setValue(name);\n \n    _this.form.doAction('submit');\n    \n}"
107                     },
108                     "*prop": "buttons[]",
109                     "text": "OK",
110                     "xtype": "Button",
111                     "|xns": "Roo"
112                 }
113             ]
114         }
115     ],
116     "permname": "",
117     "modOrder": "001"
118 }