Pman.Dialog.AdminEnumMerge.bjs
[Pman.Admin] / Pman.Dialog.AdminEnumMerge.js
1 //<script type="text/javascript">
2
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
4
5 Roo.namespace('Pman.Dialog');
6
7 Pman.Dialog.AdminEnumMerge = {
8
9  _strings : {
10   '0b3e4317865feb6f0224397600b7cafc' :"Merge Core Enum",
11   'ea4788705e6873b424c65e91c2846b19' :"Cancel",
12   'e0aa021e21dddbd6d8cecec71e9cf564' :"OK"
13  },
14
15  dialog : false,
16  callback:  false,
17
18  show : function(data, cb)
19  {
20   if (!this.dialog) {
21    this.create();
22   }
23
24   this.callback = cb;
25   this.data = data;
26   this.dialog.show(this.data._el);
27   if (this.form) {
28    this.form.reset();
29    this.form.setValues(data);
30    this.form.fireEvent('actioncomplete', this.form,  { type: 'setdata', data: data });
31   }
32
33  },
34
35  create : function()
36  {
37    var _this = this;
38    this.dialog = Roo.factory({
39     center : {
40      '|xns' : 'Roo',
41      titlebar : false,
42      xns : Roo,
43      xtype : 'LayoutRegion'
44     },
45     '|xns' : 'Roo',
46     background : true,
47     closable : false,
48     collapsible : false,
49     height : 150,
50     modal : true,
51     resizable : false,
52     title : _this._strings['0b3e4317865feb6f0224397600b7cafc'],
53     width : 400,
54     xns : Roo,
55     xtype : 'LayoutDialog',
56     buttons : [
57       {
58        '|xns' : 'Roo',
59        text : _this._strings['ea4788705e6873b424c65e91c2846b19'],
60        xns : Roo,
61        xtype : 'Button',
62        listeners : {
63         click : function() {
64              _this.form.reset();
65              _this.dialog.hide();
66          }
67        }
68       },
69 {
70        '|xns' : 'Roo',
71        text : _this._strings['e0aa021e21dddbd6d8cecec71e9cf564'],
72        xns : Roo,
73        xtype : 'Button',
74        listeners : {
75         click : function() {
76          
77              
78              _this.form.doAction('submit');
79              
80          }
81        }
82       }
83     ],
84     listeners : {
85      show : function (_self)
86       {
87       
88       }
89     },
90     items : [
91      {
92       '|xns' : 'Roo',
93       background : true,
94       fitToFrame : true,
95       region : 'center',
96       xns : Roo,
97       xtype : 'ContentPanel',
98       items : [
99        {
100         '|xns' : 'Roo.form',
101         method : 'POST',
102         style : 'margin: 5px',
103         url : baseURL + '/Roo/core_enum.php',
104         xns : Roo.form,
105         xtype : 'Form',
106         listeners : {
107          actioncomplete : function (_self, action)
108           {
109             if (action.type == 'setdata') {
110           
111                  return;
112               }
113               if (action.type == 'load') {
114                   _this.dialog.el.unmask();
115                   return;
116               }
117               if (action.type == 'submit' ) {
118                   _this.dialog.el.unmask();
119                   _this.dialog.hide();
120           
121                   if (_this.callback) {
122                      _this.callback.call(_this, action.result.data);
123                   }
124                   _this.form.reset();
125               }
126           },
127          rendered : function (form)
128           {
129              _this.form = form;
130           }
131         },
132         items : [
133          {
134           store : {
135            proxy : {
136             '|xns' : 'Roo.data',
137             method : 'GET',
138             url : baseURL + '/Roo/Core_enum.php',
139             xns : Roo.data,
140             xtype : 'HttpProxy'
141            },
142            reader : {
143             '|xns' : 'Roo.data',
144             fields : [
145                 {
146                     "name":"id",
147                     "type":"int"
148                 },
149                 {
150                     "name":"display_name",
151                     "type":"string"
152                 }
153             ],
154             id : 'id',
155             root : 'data',
156             totalProperty : 'total',
157             xns : Roo.data,
158             xtype : 'JsonReader'
159            },
160            '|xns' : 'Roo.data',
161            remoteSort : true,
162            sortInfo : { direction : 'ASC', field: 'display_name' },
163            xns : Roo.data,
164            xtype : 'Store',
165            listeners : {
166             beforeload : function (_self, o){
167                  o.params = o.params || {};
168                  
169                  o.params.active = 1;
170                  o.params.etype = _this.data.etype;
171                  o.params['!id'] = _this.data.id;
172              }
173            },
174            items : [
175
176            ]
177
178           },
179           '|xns' : 'Roo.form',
180           alwaysQuery : true,
181           displayField : 'display_name',
182           editable : true,
183           fieldLabel : 'Merge with',
184           forceSelection : true,
185           hiddenName : '_merge_id',
186           listWidth : 250,
187           minChars : 2,
188           name : 'merge_display_name',
189           pageSize : 50,
190           queryParam : 'query[search]',
191           selectOnFocus : true,
192           tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{display_name}</b> </div>',
193           triggerAction : 'all',
194           valueField : 'id',
195           width : 250,
196           xns : Roo.form,
197           xtype : 'ComboBox',
198           items : [
199
200           ]
201
202          },
203          {
204           '|xns' : 'Roo.form',
205           name : 'id',
206           xns : Roo.form,
207           xtype : 'Hidden'
208          }
209         ]
210
211        }
212       ]
213
214      }
215     ]
216
217    });
218  }
219 };