annotate app/controller/grid/Messung.js @ 591:f2742f9b5a64

Removed debug logs.
author Raimund Renkert <raimund.renkert@intevation.de>
date Wed, 11 Mar 2015 15:27:11 +0100
parents e24bc8cf8e1d
children 825973ca386f
rev   line source
588
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
2 * Software engineering by Intevation GmbH
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
3 *
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
4 * This file is Free Software under the GNU GPL (v>=3)
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
6 * the documentation coming with IMIS-Labordaten-Application for details.
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
7 */
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
8
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
9 /*
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
10 * Controller for a Messungengrid
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
11 */
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
12 Ext.define('Lada.controller.grid.Messung', {
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
13 extend: 'Ext.app.Controller',
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
14
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
15 requires: [
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
16 'Lada.view.window.MessungEdit'
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
17 ],
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
18
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
19 init: function() {
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
20 this.control({
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
21 'messungengrid': {
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
22 itemdblclick: this.editItem
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
23 },
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
24 'messungengrid button[action=add]': {
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
25 click: this.add
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
26 },
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
27 'messungengrid button[action=delete]': {
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
28 click: this.remove
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
29 }
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
30 });
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
31 },
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
32
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
33 editItem: function(grid, record) {
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
34 var win = Ext.create('Lada.view.window.MessungEdit', {
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
35 record: record
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
36 });
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
37 win.show();
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
38 win.initData();
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
39 },
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
40
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
41 add: function() {
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
42 // TODO
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
43 console.log('add');
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
44 },
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
45
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
46 remove: function(button) {
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
47 var grid = button.up('grid');
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
48 var selection = grid.getView().getSelectionModel().getSelection()[0];
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
49 Ext.MessageBox.confirm(
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
50 'Messung löschen',
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
51 'Sind Sie sicher?',
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
52 function(btn) {
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
53 if (btn === 'yes') {
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
54 selection.destroy({
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
55 success: function() {
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
56 button.up('window').initData();
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
57 },
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
58 failure: function() {
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
59 }
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
60 });
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
61 }
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
62 });
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
63 }
e24bc8cf8e1d Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
64 });

http://lada.wald.intevation.org