Pman.Dialog.CoreEnum.bjs
[Pman.Core] / Pman.Dialog.CoreEnum.bjs
1 {
2     "id": "roo-file-323",
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                                     "allowBlank": false,
50                                     "fieldLabel": "Name",
51                                     "name": "name",
52                                     "width": 200,
53                                     "xtype": "TextField",
54                                     "|xns": "Roo.form"
55                                 },
56                                 {
57                                     "allowBlank": false,
58                                     "fieldLabel": "Display Name",
59                                     "name": "display_name",
60                                     "width": 200,
61                                     "xtype": "TextField",
62                                     "|xns": "Roo.form"
63                                 },
64                                 {
65                                     "name": "etype",
66                                     "xtype": "Hidden",
67                                     "|xns": "Roo.form"
68                                 },
69                                 {
70                                     "name": "active",
71                                     "value": 1,
72                                     "xtype": "Hidden",
73                                     "|xns": "Roo.form"
74                                 },
75                                 {
76                                     "name": "seqid",
77                                     "value": 0,
78                                     "xtype": "Hidden",
79                                     "|xns": "Roo.form"
80                                 },
81                                 {
82                                     "name": "id",
83                                     "xtype": "Hidden",
84                                     "|xns": "Roo.form"
85                                 }
86                             ]
87                         }
88                     ]
89                 },
90                 {
91                     "listeners": {
92                         "|click": "function() {\n    _this.form.reset();\n    _this.dialog.hide();\n}"
93                     },
94                     "*prop": "buttons[]",
95                     "text": "Cancel",
96                     "xtype": "Button",
97                     "|xns": "Roo"
98                 },
99                 {
100                     "listeners": {
101                         "|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}"
102                     },
103                     "*prop": "buttons[]",
104                     "text": "OK",
105                     "xtype": "Button",
106                     "|xns": "Roo"
107                 }
108             ]
109         }
110     ],
111     "permname": "",
112     "modOrder": "001"
113 }