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   "03e956f1dca2b4d525df03cb1899cb6f" : "Merge with",
11   "ea4788705e6873b424c65e91c2846b19" : "Cancel",
12   "e0aa021e21dddbd6d8cecec71e9cf564" : "OK"
13  },
14  "items" : [
15   {
16    "listeners" : {
17     "show" : "function (_self)\n{\n    _this.merge.focus();\n}"
18    },
19    "modal" : true,
20    "collapsible" : false,
21    "background" : true,
22    "title" : "Merge 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      "fitToFrame" : true,
38      "background" : true,
39      "region" : "center",
40      "xtype" : "ContentPanel",
41      "$ xns" : "Roo",
42      "items" : [
43       {
44        "listeners" : {
45         "|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",
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          "listeners" : {
56           "render" : "function (_self)\n{\n    _this.merge = this;\n}"
57          },
58          "alwaysQuery" : true,
59          "Number pageSize" : 50,
60          "triggerAction" : "all",
61          "fieldLabel" : "Merge with",
62          "forceSelection" : true,
63          "selectOnFocus" : true,
64          "xtype" : "ComboBox",
65          "minChars" : 2,
66          "hiddenName" : "_merge_id",
67          "displayField" : "display_name",
68          "valueField" : "id",
69          "editable" : true,
70          "Number listWidth" : 250,
71          "width" : 250,
72          "$ xns" : "Roo.form",
73          "name" : "merge_display_name",
74          "queryParam" : "query[search]",
75          "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{display_name}</b> </div>",
76          "items" : [
77           {
78            "listeners" : {
79             "|beforeload" : "function (_self, o){\n    o.params = o.params || {};\n    \n    o.params.active = 1;\n    o.params.etype = _this.data.etype;\n    o.params['!id'] = _this.data.id;\n}\n"
80            },
81            "xtype" : "Store",
82            "remoteSort" : true,
83            "$ xns" : "Roo.data",
84            "$ sortInfo" : "{ direction : 'ASC', field: 'display_name' }",
85            "* prop" : "store",
86            "items" : [
87             {
88              "$ url" : "baseURL + '/Roo/Core_enum.php'",
89              "method" : "GET",
90              "xtype" : "HttpProxy",
91              "$ xns" : "Roo.data",
92              "* prop" : "proxy"
93             },
94             {
95              "id" : "id",
96              "root" : "data",
97              "xtype" : "JsonReader",
98              "$ xns" : "Roo.data",
99              "$ fields" : "[\n    {\n        \"name\":\"id\",\n        \"type\":\"int\"\n    },\n    {\n        \"name\":\"display_name\",\n        \"type\":\"string\"\n    }\n]",
100              "* prop" : "reader",
101              "totalProperty" : "total"
102             }
103            ]
104           }
105          ]
106         },
107         {
108          "xtype" : "Hidden",
109          "$ xns" : "Roo.form",
110          "name" : "id"
111         }
112        ]
113       }
114      ]
115     },
116     {
117      "listeners" : {
118       "|click" : "function() {\n    _this.form.reset();\n    _this.dialog.hide();\n}"
119      },
120      "text" : "Cancel",
121      "xtype" : "Button",
122      "$ xns" : "Roo",
123      "* prop" : "buttons[]"
124     },
125     {
126      "listeners" : {
127       "|click" : "function() \n{\n    if(typeof(_this.data._confirm) != 'undefined' && _this.data._confirm * 1 == 1){\n        Roo.MessageBox.confirm(\n            \"Confirm\", \n            \"Are you sure '\" + _this.data.display_name + \"' Merge with \" + _this.form.findField('merge_id'), \n            function(res) {\n                if(res != 'yes') {\n                    return;\n                }\n                new Pman.Request({\n                    method : 'POST',\n                    url : baseURL + '/Roo/Core_enum',\n                    params : {\n                        _delete  : ids.join(',')\n                    },\n                    success : function() {\n                        _this.grid.footer.onClick('refresh');\n                    }\n                });\n            }\n        );\n    }\n    _this.form.doAction('submit');\n    \n}"
128      },
129      "text" : "OK",
130      "xtype" : "Button",
131      "$ xns" : "Roo",
132      "* prop" : "buttons[]"
133     }
134    ]
135   }
136  ]
137 }