comparison app/controller/MKommentare.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 850ccfe5f3c4
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 /** 9 /**
10 * Controller for Kommentare on Messungen 10 * Controller for Kommentare on Messungen
11 */ 11 */
52 52
53 addItem: function(button) { 53 addItem: function(button) {
54 var kommentar = Ext.create('Lada.model.KommentarM'); 54 var kommentar = Ext.create('Lada.model.KommentarM');
55 kommentar.set('probeId', button.probeId); 55 kommentar.set('probeId', button.probeId);
56 kommentar.set('messungsId', button.parentId); 56 kommentar.set('messungsId', button.parentId);
57 var view = Ext.widget('mkommentarecreate', {model: kommentar}); 57 Ext.widget('mkommentarecreate', {
58 model: kommentar
59 });
58 }, 60 },
59 61
60 editItem: function(grid, record) { 62 editItem: function(grid, record) {
61 console.log('Editing Kommentar'); 63 console.log('Editing Kommentar');
62 var mstore = Ext.data.StoreManager.get('Messungen'); 64 var mstore = Ext.data.StoreManager.get('Messungen');
63 var messung = mstore.getById(record.get('messungsId')); 65 var messung = mstore.getById(record.get('messungsId'));
64 record.getAuthInfo(this.initEditWindow, messung.get('probeId')) 66 record.getAuthInfo(this.initEditWindow, messung.get('probeId'));
65 console.log("Loaded MKommentar with ID " + record.getId()); //outputs ID 67 console.log('Loaded MKommentar with ID ' + record.getId());
66 }, 68 },
67 69
68 initEditWindow: function(record, readonly, owner) { 70 initEditWindow: function(record, readonly) {
69 var view = Ext.widget('mkommentarecreate', { 71 var view = Ext.widget('mkommentarecreate', {
70 model: record 72 model: record
71 }); 73 });
72 var ignore = Array(); 74 var ignore = [];
73 if (readonly) { 75 if (readonly) {
74 var form = view.down('form'); 76 var form = view.down('form');
75 form.setReadOnly(true, ignore); 77 form.setReadOnly(true, ignore);
76 } 78 }
77 }, 79 },
78 80
79 createSuccess: function(form, record, operation) { 81 createSuccess: function(form) {
80 // Reload store 82 // Reload store
81 var store = this.getKommentareMStore(); 83 var store = this.getKommentareMStore();
82 store.reload(); 84 store.reload();
83 var win = form.up('window'); 85 var win = form.up('window');
84 win.close(); 86 win.close();

http://lada.wald.intevation.org