comparison app/controller/Proben.js @ 499:8b4ec61c5752

Removed most log messages to make the application less verbose.
author Raimund Renkert <raimund.renkert@intevation.de>
date Thu, 06 Nov 2014 11:12:21 +0100
parents 7c0653e8d9f7
children ad7f574b382a
comparison
equal deleted inserted replaced
498:c1b77fb96b01 499:8b4ec61c5752
106 'Orte', 106 'Orte',
107 'Messungen' 107 'Messungen'
108 ], 108 ],
109 109
110 init: function() { 110 init: function() {
111 console.log('Initialising the Proben controller');
112 this.callParent(arguments); 111 this.callParent(arguments);
113 }, 112 },
114 113
115 addListeners: function() { 114 addListeners: function() {
116 this.control({ 115 this.control({
145 } 144 }
146 }); 145 });
147 }, 146 },
148 147
149 addItem: function() { 148 addItem: function() {
150 console.log('Adding new Probe');
151 Ext.widget('probencreate'); 149 Ext.widget('probencreate');
152 }, 150 },
153 151
154 /** 152 /**
155 * Opens a window with a file chooser to select the file to upload 153 * Opens a window with a file chooser to select the file to upload
156 * @private 154 * @private
157 */ 155 */
158 selectUploadFile: function() { 156 selectUploadFile: function() {
159 console.log('Importing');
160 Ext.widget('probenimport'); 157 Ext.widget('probenimport');
161 }, 158 },
162 159
163 /** Uploads the selected file the the server 160 /** Uploads the selected file the the server
164 * @private 161 * @private
208 xtype: 'hiddenfield', 205 xtype: 'hiddenfield',
209 name: 'probeId', 206 name: 'probeId',
210 value: selection[i].get('probeId') 207 value: selection[i].get('probeId')
211 }); 208 });
212 } 209 }
213 console.log('create download form.');
214 var hiddenForm = Ext.create('Ext.form.Panel', { 210 var hiddenForm = Ext.create('Ext.form.Panel', {
215 title: 'hiddenForm', 211 title: 'hiddenForm',
216 standardSubmit: true, 212 standardSubmit: true,
217 url: 'server/rest/export/laf', 213 url: 'server/rest/export/laf',
218 timeout: 120, 214 timeout: 120,
223 }); 219 });
224 hiddenForm.getForm().submit(); 220 hiddenForm.getForm().submit();
225 }, 221 },
226 222
227 editItem: function(grid, record) { 223 editItem: function(grid, record) {
228 console.log('Editing Probe');
229 var id = record.get('id'); 224 var id = record.get('id');
230 console.log('id is: ' + id);
231 // Load Zusatzwerte 225 // Load Zusatzwerte
232 var pstore = Ext.data.StoreManager.get('staProbenzusaetze'); 226 var pstore = Ext.data.StoreManager.get('staProbenzusaetze');
233 pstore.load(); 227 pstore.load();
234 var zstore = this.getZusatzwerteStore(); 228 var zstore = this.getZusatzwerteStore();
235 zstore.load({ 229 zstore.load({
260 }); 254 });
261 var view = Ext.widget('probenedit', { 255 var view = Ext.widget('probenedit', {
262 modelId: id 256 modelId: id
263 }); 257 });
264 view.show(); 258 view.show();
265 console.log('Loaded Probe with ID ' + record.getId());
266 }, 259 },
267 260
268 createSuccess: function(form, record, response) { 261 createSuccess: function(form, record, response) {
269 // Close Createdialog 262 // Close Createdialog
270 var win = form.up('window'); 263 var win = form.up('window');
273 // Load or reload the probenstore. 266 // Load or reload the probenstore.
274 if (store.getCount() === 0) { 267 if (store.getCount() === 0) {
275 store.load({ 268 store.load({
276 scope: this, 269 scope: this,
277 callback: function() { 270 callback: function() {
278 console.log('Loaded store');
279 // Open Editdialog 271 // Open Editdialog
280 var json = Ext.decode(response.responseText); 272 var json = Ext.decode(response.responseText);
281 if (json) { 273 if (json) {
282 var probeId = json.data.probeId; 274 var probeId = json.data.probeId;
283 var probe = store.findRecord('probeId', probeId); 275 var probe = store.findRecord('probeId', probeId);
288 } 280 }
289 else { 281 else {
290 store.reload({ 282 store.reload({
291 scope: this, 283 scope: this,
292 callback: function() { 284 callback: function() {
293 console.log('Reloaded store');
294 // Open Editdialog 285 // Open Editdialog
295 var json = Ext.decode(response.responseText); 286 var json = Ext.decode(response.responseText);
296 if (json) { 287 if (json) {
297 var probeId = json.data.probeId; 288 var probeId = json.data.probeId;
298 var probe = store.findRecord('probeId', probeId); 289 var probe = store.findRecord('probeId', probeId);

http://lada.wald.intevation.org