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