comparison app/controller/Zusatzwerte.js @ 497:7c0653e8d9f7

Fixed some js related issues (unused vars, arrays, etc.) and code style.
author Raimund Renkert <raimund.renkert@intevation.de>
date Thu, 06 Nov 2014 10:38:17 +0100
parents d07e5086a64b
children 8b4ec61c5752
comparison
equal deleted inserted replaced
496:d07e5086a64b 497:7c0653e8d9f7
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz 1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz
2 * Software engineering by Intevation GmbH 2 * Software engineering by Intevation GmbH
3 * 3 *
4 * This file is Free Software under the GNU GPL (v>=3) 4 * This file is Free Software under the GNU GPL (v>=3)
5 * and comes with ABSOLUTELY NO WARRANTY! Check out 5 * and comes with ABSOLUTELY NO WARRANTY! Check out
6 * the documentation coming with IMIS-Labordaten-Application for details. 6 * the documentation coming with IMIS-Labordaten-Application for details.
7 */ 7 */
8 8
9 Ext.define('Lada.controller.Zusatzwerte', { 9 Ext.define('Lada.controller.Zusatzwerte', {
10 extend: 'Lada.controller.Base', 10 extend: 'Lada.controller.Base',
11 views: [ 11 views: [
54 54
55 addItem: function(button) { 55 addItem: function(button) {
56 console.log('Adding new Zusatzwert for Probe' + button.probeId); 56 console.log('Adding new Zusatzwert for Probe' + button.probeId);
57 var zusatzwert = Ext.create('Lada.model.Zusatzwert'); 57 var zusatzwert = Ext.create('Lada.model.Zusatzwert');
58 zusatzwert.set('probeId', button.probeId); 58 zusatzwert.set('probeId', button.probeId);
59 var view = Ext.widget('zusatzwertecreate', { 59 Ext.widget('zusatzwertecreate', {
60 model: zusatzwert 60 model: zusatzwert
61 }); 61 });
62 }, 62 },
63 63
64 editItem: function(grid, record) { 64 editItem: function(grid, record) {
65 console.log('Editing Zusatzwert'); 65 console.log('Editing Zusatzwert');
66 record.getAuthInfo(this.initEditWindow) 66 record.getAuthInfo(this.initEditWindow);
67 console.log("Loaded Zusatzwert with ID " + record.getId()); //outputs ID
68 }, 67 },
69 68
70 initEditWindow: function(record, readonly, owner) { 69 initEditWindow: function(record, readonly) {
71 var view = Ext.widget('zusatzwertecreate', { 70 var view = Ext.widget('zusatzwertecreate', {
72 model: record 71 model: record
73 }); 72 });
74 // Mark PZW Selection readonly. 73 // Mark PZW Selection readonly.
75 view.down('probenzusatzwert').disabled = true; 74 view.down('probenzusatzwert').disabled = true;
76 var ignore = Array(); 75 var ignore = [];
77 if (readonly) { 76 if (readonly) {
78 var form = view.down('form'); 77 var form = view.down('form');
79 form.setReadOnly(true, ignore); 78 form.setReadOnly(true, ignore);
80 } 79 }
81 }, 80 },
82 81
83 createSuccess: function(form, record, operation) { 82 createSuccess: function(form) {
84 // Reload store 83 // Reload store
85 var store = this.getZusatzwerteStore(); 84 var store = this.getZusatzwerteStore();
86 store.reload(); 85 store.reload();
87 var win = form.up('window'); 86 var win = form.up('window');
88 win.close(); 87 win.close();
89 }, 88 },
90 89
91 editSuccess: function(form, record, operation) { 90 editSuccess: function(form) {
92 // Reload store 91 // Reload store
93 var store = this.getZusatzwerteStore(); 92 var store = this.getZusatzwerteStore();
94 store.reload(); 93 store.reload();
95 var win = form.up('window'); 94 var win = form.up('window');
96 win.close(); 95 win.close();

http://lada.wald.intevation.org