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": false,
53                                     "name": "name",
54                                     "width": 200,
55                                     "xtype": "TextField",
56                                     "|xns": "Roo.form"
57                                 },
58                                 {
59                                     "listeners": {
60                                         "keyup": "function (_self, e)\n{\n    _this.form.findField('name').setValue(this.getValue().replace(/[^a-z0-9]/ig, '').toUpperCase());\n    \n}"
61                                     },
62                                     "allowBlank": false,
63                                     "fieldLabel": "Display Name",
64                                     "name": "display_name",
65                                     "width": 200,
66                                     "xtype": "TextField",
67                                     "|xns": "Roo.form"
68                                 },
69                                 {
70                                     "fieldLabel": "Active",
71                                     "inputValue": 1,
72                                     "name": "active",
73                                     "value": 0,
74                                     "valueOff": 0,
75                                     "xtype": "Checkbox",
76                                     "|xns": "Roo.form"
77                                 },
78                                 {
79                                     "name": "etype",
80                                     "xtype": "Hidden",
81                                     "|xns": "Roo.form"
82                                 },
83                                 {
84                                     "name": "seqid",
85                                     "value": 0,
86                                     "xtype": "Hidden",
87                                     "|xns": "Roo.form"
88                                 },
89                                 {
90                                     "name": "id",
91                                     "xtype": "Hidden",
92                                     "|xns": "Roo.form"
93                                 }
94                             ]
95                         }
96                     ]
97                 },
98                 {
99                     "listeners": {
100                         "|click": "function() {\n    _this.form.reset();\n    _this.dialog.hide();\n}"
101                     },
102                     "*prop": "buttons[]",
103                     "text": "Cancel",
104                     "xtype": "Button",
105                     "|xns": "Roo"
106                 },
107                 {
108                     "listeners": {
109                         "|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}"
110                     },
111                     "*prop": "buttons[]",
112                     "text": "OK",
113                     "xtype": "Button",
114                     "|xns": "Roo"
115                 }
116             ]
117         }
118     ],
119     "permname": "",
120     "modOrder": "001"
121 }