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   "ea4788705e6873b424c65e91c2846b19" : "Cancel",
11   "e0aa021e21dddbd6d8cecec71e9cf564" : "OK"
12  },
13  "items" : [
14   {
15    "modal" : true,
16    "collapsible" : false,
17    "background" : true,
18    "title" : "Merge Core Enum",
19    "xtype" : "LayoutDialog",
20    "width" : 400,
21    "$ xns" : "Roo",
22    "closable" : false,
23    "resizable" : false,
24    "height" : 150,
25    "items" : [
26     {
27      "xtype" : "LayoutRegion",
28      "$ xns" : "Roo",
29      "titlebar" : false,
30      "* prop" : "center"
31     },
32     {
33      "fitToFrame" : true,
34      "background" : true,
35      "region" : "center",
36      "xtype" : "ContentPanel",
37      "$ xns" : "Roo",
38      "items" : [
39       {
40        "listeners" : {
41         "|actioncomplete" : "function (_self, action)\n{\n  if (action.type == 'setdata') {\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",
42         "|rendered" : "function (form)\n{\n   _this.form = form;\n}"
43        },
44        "$ url" : "baseURL + '/Roo/core_enum.php'",
45        "xtype" : "Form",
46        "method" : "POST",
47        "style" : "margin: 5px",
48        "$ xns" : "Roo.form",
49        "items" : [
50         {
51          "listeners" : {
52           "add" : "function (combo)\n{\n    Pman.Dialog.CoreEnum.show({\n        etype : 'EuroCham.Industry',\n        title : 'Add Industry'\n    }, function(res){\n        combo.setFromData(res);\n    })\n}"
53          },
54          "alwaysQuery" : true,
55          "Number pageSize" : 50,
56          "triggerAction" : "all",
57          "fieldLabel" : "Industry",
58          "forceSelection" : true,
59          "selectOnFocus" : true,
60          "xtype" : "ComboBox",
61          "minChars" : 2,
62          "hiddenName" : "industry_id",
63          "displayField" : "display_name",
64          "valueField" : "id",
65          "editable" : true,
66          "Number listWidth" : 400,
67          "width" : 300,
68          "$ xns" : "Roo.form",
69          "name" : "industry_id_display_name",
70          "queryParam" : "query[search]",
71          "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{display_name}</b> </div>",
72          "items" : [
73           {
74            "listeners" : {
75             "|beforeload" : "function (_self, o){\n    o.params = o.params || {};\n    \n    o.params.active = 1;\n    o.params.etype = 'EuroCham.Industry';\n}\n"
76            },
77            "xtype" : "Store",
78            "remoteSort" : true,
79            "$ xns" : "Roo.data",
80            "$ sortInfo" : "{ direction : 'ASC', field: 'id' }",
81            "* prop" : "store",
82            "items" : [
83             {
84              "$ url" : "baseURL + '/Roo/Core_enum.php'",
85              "xtype" : "HttpProxy",
86              "method" : "GET",
87              "$ xns" : "Roo.data",
88              "* prop" : "proxy"
89             },
90             {
91              "id" : "id",
92              "root" : "data",
93              "xtype" : "JsonReader",
94              "$ xns" : "Roo.data",
95              "$ fields" : "[\n    {\n        \"name\":\"name\",\n        \"type\":\"string\"\n    },\n    {\n        \"name\":\"display_name\",\n        \"type\":\"string\"\n    }\n]",
96              "* prop" : "reader",
97              "totalProperty" : "total"
98             }
99            ]
100           }
101          ]
102         },
103         {
104          "xtype" : "Hidden",
105          "$ xns" : "Roo.form",
106          "name" : "id"
107         }
108        ]
109       }
110      ]
111     },
112     {
113      "listeners" : {
114       "|click" : "function() {\n    _this.form.reset();\n    _this.dialog.hide();\n}"
115      },
116      "text" : "Cancel",
117      "xtype" : "Button",
118      "$ xns" : "Roo",
119      "* prop" : "buttons[]"
120     },
121     {
122      "listeners" : {
123       "|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}"
124      },
125      "text" : "OK",
126      "xtype" : "Button",
127      "$ xns" : "Roo",
128      "* prop" : "buttons[]"
129     }
130    ]
131   }
132  ]
133 }