Pman.Dialog.CoreEnum.bjs
[Pman.Core] / Pman.Dialog.CoreEnum.bjs
1 {
2  "name" : "Pman.Dialog.CoreEnum",
3  "parent" : "",
4  "title" : "",
5  "path" : "/home/edward/gitlive/Pman.Core/Pman.Dialog.CoreEnum.bjs",
6  "permname" : "",
7  "modOrder" : "001",
8  "strings" : {
9   "518ad9ed87d3ca17e223a91604b464d5" : "Add / Edit Core Enum",
10   "cfcd208495d565ef66e7dff9f98764da" : "0",
11   "c4ca4238a0b923820dcc509a6f75849b" : "1",
12   "ea4788705e6873b424c65e91c2846b19" : "Cancel",
13   "e0aa021e21dddbd6d8cecec71e9cf564" : "OK"
14  },
15  "items" : [
16   {
17    "listeners" : {
18     "show" : "function (_self)\n{\n    \n}"
19    },
20    "modal" : true,
21    "collapsible" : false,
22    "background" : true,
23    "title" : "Add / Edit Core Enum",
24    "xtype" : "LayoutDialog",
25    "width" : 400,
26    "$ xns" : "Roo",
27    "closable" : false,
28    "resizable" : false,
29    "height" : 150,
30    "items" : [
31     {
32      "xtype" : "LayoutRegion",
33      "$ xns" : "Roo",
34      "titlebar" : false,
35      "* prop" : "center"
36     },
37     {
38      "region" : "center",
39      "fitToFrame" : true,
40      "background" : true,
41      "xtype" : "ContentPanel",
42      "$ xns" : "Roo",
43      "items" : [
44       {
45        "listeners" : {
46         "|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",
47         "|rendered" : "function (form)\n{\n   _this.form = form;\n}"
48        },
49        "$ url" : "baseURL + '/Roo/core_enum.php'",
50        "method" : "POST",
51        "xtype" : "Form",
52        "style" : "margin: 5px",
53        "$ xns" : "Roo.form",
54        "items" : [
55         {
56          "fieldLabel" : "Name",
57          "hidden" : true,
58          "xtype" : "TextField",
59          "allowBlank" : false,
60          "actionMode" : "fieldEl",
61          "width" : 200,
62          "$ xns" : "Roo.form",
63          "name" : "name"
64         },
65         {
66          "listeners" : {
67           "keyup" : "function (_self, e)\n{\n    _this.form.findField('name').setValue(this.getValue().replace(/[^a-z0-9]/ig, '').toUpperCase());\n    \n}"
68          },
69          "fieldLabel" : "Display Name",
70          "xtype" : "TextField",
71          "allowBlank" : false,
72          "width" : 200,
73          "$ xns" : "Roo.form",
74          "name" : "display_name"
75         },
76         {
77          "fieldLabel" : "Active",
78          "inputValue" : 1,
79          "value" : 0,
80          "xtype" : "Checkbox",
81          "valueOff" : 0,
82          "$ xns" : "Roo.form",
83          "name" : "active"
84         },
85         {
86          "xtype" : "Hidden",
87          "$ xns" : "Roo.form",
88          "name" : "etype"
89         },
90         {
91          "xtype" : "Hidden",
92          "$ xns" : "Roo.form",
93          "Mixed value" : 1,
94          "name" : "active"
95         },
96         {
97          "xtype" : "Hidden",
98          "value" : 0,
99          "$ xns" : "Roo.form",
100          "name" : "seqid"
101         },
102         {
103          "xtype" : "Hidden",
104          "$ xns" : "Roo.form",
105          "name" : "id"
106         }
107        ]
108       }
109      ]
110     },
111     {
112      "listeners" : {
113       "|click" : "function() {\n    _this.form.reset();\n    _this.dialog.hide();\n}"
114      },
115      "text" : "Cancel",
116      "xtype" : "Button",
117      "$ xns" : "Roo",
118      "* prop" : "buttons[]"
119     },
120     {
121      "listeners" : {
122       "|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}"
123      },
124      "text" : "OK",
125      "xtype" : "Button",
126      "$ xns" : "Roo",
127      "* prop" : "buttons[]"
128     }
129    ]
130   }
131  ]
132 }