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