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": 100,
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        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": "Industry Name",
59                                     "name": "display_name",
60                                     "width": 200,
61                                     "xtype": "TextField",
62                                     "|xns": "Roo.form"
63                                 },
64                                 {
65                                     "name": "id",
66                                     "xtype": "Hidden",
67                                     "|xns": "Roo.form"
68                                 }
69                             ]
70                         }
71                     ]
72                 },
73                 {
74                     "listeners": {
75                         "|click": "function() {\n    _this.form.reset();\n    _this.dialog.hide();\n}"
76                     },
77                     "*prop": "buttons[]",
78                     "text": "Cancel",
79                     "xtype": "Button",
80                     "|xns": "Roo"
81                 },
82                 {
83                     "listeners": {
84                         "|click": "function() {\n\n    var name =     _this.form.findField('display_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 \n    _this.form.doAction('submit');\n    \n}"
85                     },
86                     "*prop": "buttons[]",
87                     "text": "OK",
88                     "xtype": "Button",
89                     "|xns": "Roo"
90                 }
91             ]
92         }
93     ],
94     "permname": "",
95     "modOrder": "001"
96 }