Mercurial > lada > lada-client
comparison app/controller/Kommentare.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 | 10 * Controller for Kommentare |
11 */ | 11 */ |
52 | 52 |
53 addItem: function(button) { | 53 addItem: function(button) { |
54 console.log('Adding new Kommentar for Probe ' + button.probeId); | 54 console.log('Adding new Kommentar for Probe ' + button.probeId); |
55 var kommentar = Ext.create('Lada.model.KommentarP'); | 55 var kommentar = Ext.create('Lada.model.KommentarP'); |
56 kommentar.set('probeId', button.probeId); | 56 kommentar.set('probeId', button.probeId); |
57 var view = Ext.widget('kommentarecreate', { | 57 Ext.widget('kommentarecreate', { |
58 model: kommentar | 58 model: kommentar |
59 }); | 59 }); |
60 }, | 60 }, |
61 | 61 |
62 editItem: function(grid, record) { | 62 editItem: function(grid, record) { |
63 console.log('Editing Kommentar'); | 63 console.log('Editing Kommentar'); |
64 record.getAuthInfo(this.initEditWindow) | 64 record.getAuthInfo(this.initEditWindow); |
65 console.log("Loaded Kommentar with ID " + record.getId()); //outputs ID | 65 console.log('Loaded Kommentar with ID ' + record.getId()); |
66 }, | 66 }, |
67 | 67 |
68 initEditWindow: function(record, readonly, owner) { | 68 initEditWindow: function(record, readonly) { |
69 var view = Ext.widget('kommentarecreate', { | 69 var view = Ext.widget('kommentarecreate', { |
70 model: record | 70 model: record |
71 }); | 71 }); |
72 var ignore = Array(); | 72 var ignore = []; |
73 if (readonly) { | 73 if (readonly) { |
74 var form = view.down('form'); | 74 var form = view.down('form'); |
75 form.setReadOnly(true, ignore); | 75 form.setReadOnly(true, ignore); |
76 } | 76 } |
77 }, | 77 }, |
78 | 78 |
79 createSuccess: function(form, record, operation) { | 79 createSuccess: function(form) { |
80 var store = this.getKommentarePStore(); | 80 var store = this.getKommentarePStore(); |
81 store.reload(); | 81 store.reload(); |
82 var win = form.up('window'); | 82 var win = form.up('window'); |
83 win.close(); | 83 win.close(); |
84 } | 84 } |