Pman.Dialog.BAdminCoreEnum.bjs
[Pman.BAdmin] / Pman.Dialog.BAdminCoreEnum.bjs
1 {
2  "name" : "Pman.Dialog.BAdminCoreEnum",
3  "parent" : "",
4  "title" : "",
5  "path" : "/home/edward/gitlive/Pman.BAdmin/Pman.Dialog.BAdminCoreEnum.bjs",
6  "permname" : "",
7  "modOrder" : "001",
8  "strings" : {
9   "d5cf6a6c4887716d7a14a84d9ba81b02" : "Add / Edit Pulldown Option",
10   "b48968e1c912da07df5e8d6d246291ec" : "Display Name",
11   "ea4788705e6873b424c65e91c2846b19" : "Cancel",
12   "49ee3087348e8d44e1feda1917443987" : "Name",
13   "c9cc8cce247e49bae79f15173ce97354" : "Save"
14  },
15  "items" : [
16   {
17    "String cls" : "enable-overflow",
18    "xtype" : "Modal",
19    "$ xns" : "Roo.bootstrap",
20    "String title" : "Add / Edit Pulldown Option",
21    "items" : [
22     {
23      "listeners" : {
24       "actionfailed" : "function (_self, action)\n{\n    Roo.bootstrap.MessageBox.alert('Error', action.result.errorMsg);\n}",
25       "actioncomplete" : "function (_self, action)\n{\n    if(action.type == 'setdata'){\n    \n       if(_this.data.id * 1 > 0) {\n            this.doAction('load',{ method: 'GET', params: { '_id' : _this.data.id }});\n        } \n        \n        return;\n    }\n   \n    if (action.type == 'load') {\n        _this.data = action.result.data;\n        return;\n    }\n    \n    \n    if (action.type == 'submit') {\n    \n        _this.dialog.hide();\n       \n        if (_this.callback) {\n            _this.callback.call(this, action.result.data);\n        }\n        \n        return; \n    }\n}",
26       "render" : "function (_self)\n{\n    _this.form = _self;\n}"
27      },
28      "$ url" : "baseURL + '/Roo/Core_group' ",
29      "xtype" : "Form",
30      "String labelAlign" : "top",
31      "$ xns" : "Roo.bootstrap",
32      "items" : [
33       {
34        "String name" : "name",
35        "xtype" : "Input",
36        "string placeholder" : "Name",
37        "$ xns" : "Roo.bootstrap"
38       },
39       {
40        "String name" : "display_name",
41        "xtype" : "Input",
42        "string placeholder" : "Display Name",
43        "$ xns" : "Roo.bootstrap"
44       },
45       {
46        "xtype" : "CheckBox",
47        "String boxLabel" : "Active",
48        "$ xns" : "Roo.bootstrap"
49       },
50       {
51        "String name" : "id",
52        "xtype" : "Input",
53        "String inputType" : "hidden",
54        "$ xns" : "Roo.bootstrap"
55       },
56       {
57        "String name" : "etype",
58        "xtype" : "Input",
59        "String inputType" : "hidden",
60        "$ xns" : "Roo.bootstrap"
61       }
62      ]
63     },
64     {
65      "listeners" : {
66       "click" : "function (_self, e)\n{\n    _this.dialog.hide(); \n}"
67      },
68      "xtype" : "Button",
69      "$ xns" : "Roo.bootstrap",
70      "String html" : "Cancel",
71      "* prop" : "buttons[]"
72     },
73     {
74      "listeners" : {
75       "click" : "function (_self, e)\n{\n    if(!_this.form.isValid()){\n        Roo.bootstrap.MessageBox.alert('Error', 'Please Correct all the errors in red');\n        return;\n    }\n    \n    var myID = _this.form.findField('id').getValue() * 1;\n    var myName = _this.form.findField('name').getValue();\n\n    if (_this.form.findField('company_id') && !_this.form.findField('company_id').getValue()) {\n        Roo.bootstrap.MessageBox.alert(\"Error\", \"Select a Company\");\n        return;\n    }\n        \n       // validate password match (only needed if we are not using generated one..\n    if (_this.form.findField('passwd1') \n            && _this.form.findField('passwd1').getValue().length > 0 \n            && _this.form.findField('passwd1').inputEl().dom.type == \"password\") {\n            \n        var p1 = _this.form.findField('passwd1').getValue();\n        var p2 = _this.form.findField('passwd2').getValue();\n            \n            \n        if (Pman.Login.authUser.id < 0 && !p1.length) {\n            Roo.bootstrap.MessageBox.alert(\"Error\", \"You must create a password for the admin account\");\n            return;\n        }\n            \n            \n        if (p1.length || p2.length) {\n            if (p1 != p2) {\n                Roo.bootstrap.MessageBox.alert(\"Error\", \"Passwords do not match\");\n                return;\n            }\n        }\n            \n        \n    }\n    _this.form.doAction(\"submit\");\n\n  \n\n    return;\n}"
76      },
77      "String weight" : "primary",
78      "xtype" : "Button",
79      "$ xns" : "Roo.bootstrap",
80      "String html" : "Save",
81      "* prop" : "buttons[]"
82     }
83    ]
84   }
85  ]
86 }