Pman.Dialog.CmsTranslateTemplates.bjs
[Pman.Cms] / Pman.Dialog.CmsTranslateTemplates.js
1 //<script type="text/javascript">
2
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
4
5 Pman.Dialog.CmsTranslateTemplates = {
6
7     dialog : false,
8     callback:  false,
9
10     show : function(data, cb)
11     {
12         if (!this.dialog) {
13             this.create();
14         }
15
16         this.callback = cb;
17         this.data = data;
18         this.dialog.show(this.data._el);
19         if (this.form) {
20            this.form.reset();
21            this.form.setValues(data);
22            this.form.fireEvent('actioncomplete', this.form,  { type: 'setdata', data: data });
23         }
24
25     },
26
27     create : function()
28     {
29         var _this = this;
30         this.dialog = Roo.factory({
31             xtype: 'LayoutDialog',
32             xns: Roo,
33             background : true,
34             closable : false,
35             collapsible : false,
36             height : 300,
37             modal : true,
38             resizable : false,
39             title : "Add / Edit Location Details",
40             width : 400,
41             items : [
42                 {
43                     xtype: 'ContentPanel',
44                     xns: Roo,
45                     background : true,
46                     fitToFrame : true,
47                     region : 'center',
48                     items : [
49                         {
50                             xtype: 'Form',
51                             xns: Roo.form,
52                             listeners : {
53                                 actionfailed : function (_self, action)
54                                 {
55                                     _this.dialog.el.unmask();
56                                     Pman.standardActionFailed(_self, action);
57                                 },
58                                 actioncomplete : function (_self, action)
59                                 {
60                                       
61                                     if (action.type == 'setdata') {
62                                        //_this.dialog.el.mask("Loading");
63                                        if (_this.data.id) {
64                                            this.load({ method: 'GET', params: { '_id' : _this.data.id }});
65                                        }
66                                        return;
67                                     }
68                                     if (action.type == 'load') {
69                                          return;
70                                     }
71                                     if (action.type =='submit') {
72                                         _this.dialog.hide();
73                                         if (_this.callback) {
74                                             _this.callback.call(_this, _this.form.getValues());
75                                         }
76                                         _this.form.reset();
77                                         return;
78                                     }
79                                 },
80                                 rendered : function (form)
81                                 {
82                                    _this.form = form;
83                                 }
84                             },
85                             method : 'POST',
86                             style : 'margin: 5px',
87                             url : baseURL + '/Roo/Ris_location.php',
88                             items : [
89                                 {
90                                     xtype: 'Row',
91                                     xns: Roo.form,
92                                     hideLabels : true,
93                                     labelWidth : 100,
94                                     items : [
95                                         {
96                                             xtype: 'DisplayField',
97                                             xns: Roo.form,
98                                             vtype : 'url',
99                                             fieldLabel : 'test',
100                                             name : 'wrin_text',
101                                             value : "",
102                                             width : 200
103                                         }
104                                     ]
105                                 },
106                                 {
107                                     xtype: 'Row',
108                                     xns: Roo.form,
109                                     labelAlign : 'top',
110                                     items : [
111                                         {
112                                             xtype: 'TextArea',
113                                             xns: Roo.form,
114                                             disabled : true,
115                                             fieldLabel : 'Original',
116                                             name : 'src_id_txt',
117                                             value : "teststsetetsetsete"
118                                         }
119                                     ]
120                                 },
121                                 {
122                                     xtype: 'Row',
123                                     xns: Roo.form,
124                                     labelAlign : 'top',
125                                     items : [
126                                         {
127                                             xtype: 'TextArea',
128                                             xns: Roo.form,
129                                             fieldLabel : 'Translation',
130                                             name : 'txt'
131                                         }
132                                     ]
133                                 }
134                             ]
135                         }
136                     ]
137                 }
138             ],
139             center : {
140                 xtype: 'LayoutRegion',
141                 xns: Roo,
142                 titlebar : false
143             },
144             buttons : [
145                 {
146                     xtype: 'Button',
147                     xns: Roo,
148                     text : "Cancel",
149                     listeners : {
150                         click : function() {
151                             _this.form.reset();
152                             _this.dialog.hide();
153                         }
154                     }
155                 },
156                 {
157                     xtype: 'Button',
158                     xns: Roo,
159                     text : "OK",
160                     listeners : {
161                         click : function() {
162                             _this.dialog.el.mask("Saving");
163                             _this.form.doAction('submit');
164                             
165                         }
166                     }
167                 }
168             ]
169         });
170     }
171 };