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