annotate app/controller/ModeSwitcher.js @ 1013:75ce503ab296 stammdatengrids

Added a Ortszuordnungwindow and Form
author Dustin Demuth <dustin@intevation.de>
date Tue, 26 Jan 2016 12:29:59 +0100
parents 7f5219b8e1bf
children af9879d72310
rev   line source
747
3ffecbce17d6 Radio-Buttons to switch between query-modes: Probenliste und Probenplanung. Filter-Combobox store wird automatisch gewechselt. ToDo: Query-Store für Probenplanung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz
3ffecbce17d6 Radio-Buttons to switch between query-modes: Probenliste und Probenplanung. Filter-Combobox store wird automatisch gewechselt. ToDo: Query-Store für Probenplanung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
2 * Software engineering by Intevation GmbH
3ffecbce17d6 Radio-Buttons to switch between query-modes: Probenliste und Probenplanung. Filter-Combobox store wird automatisch gewechselt. ToDo: Query-Store für Probenplanung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
3 *
3ffecbce17d6 Radio-Buttons to switch between query-modes: Probenliste und Probenplanung. Filter-Combobox store wird automatisch gewechselt. ToDo: Query-Store für Probenplanung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
4 * This file is Free Software under the GNU GPL (v>=3)
3ffecbce17d6 Radio-Buttons to switch between query-modes: Probenliste und Probenplanung. Filter-Combobox store wird automatisch gewechselt. ToDo: Query-Store für Probenplanung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out
3ffecbce17d6 Radio-Buttons to switch between query-modes: Probenliste und Probenplanung. Filter-Combobox store wird automatisch gewechselt. ToDo: Query-Store für Probenplanung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
6 * the documentation coming with IMIS-Labordaten-Application for details.
3ffecbce17d6 Radio-Buttons to switch between query-modes: Probenliste und Probenplanung. Filter-Combobox store wird automatisch gewechselt. ToDo: Query-Store für Probenplanung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
7 */
3ffecbce17d6 Radio-Buttons to switch between query-modes: Probenliste und Probenplanung. Filter-Combobox store wird automatisch gewechselt. ToDo: Query-Store für Probenplanung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
8
3ffecbce17d6 Radio-Buttons to switch between query-modes: Probenliste und Probenplanung. Filter-Combobox store wird automatisch gewechselt. ToDo: Query-Store für Probenplanung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
9 /**
978
7f5219b8e1bf Renamed the ProbePlanungSwitcher to a more generic ModeSwitcher and refactored the application
Dustin Demuth <dustin@intevation.de>
parents: 975
diff changeset
10 * Controller for the ModeSwitcher
7f5219b8e1bf Renamed the ProbePlanungSwitcher to a more generic ModeSwitcher and refactored the application
Dustin Demuth <dustin@intevation.de>
parents: 975
diff changeset
11 * This controller handles all logic related to the ModeSwitch
747
3ffecbce17d6 Radio-Buttons to switch between query-modes: Probenliste und Probenplanung. Filter-Combobox store wird automatisch gewechselt. ToDo: Query-Store für Probenplanung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
12 */
978
7f5219b8e1bf Renamed the ProbePlanungSwitcher to a more generic ModeSwitcher and refactored the application
Dustin Demuth <dustin@intevation.de>
parents: 975
diff changeset
13 Ext.define('Lada.controller.ModeSwitcher', {
747
3ffecbce17d6 Radio-Buttons to switch between query-modes: Probenliste und Probenplanung. Filter-Combobox store wird automatisch gewechselt. ToDo: Query-Store für Probenplanung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
14 extend: 'Ext.app.Controller',
3ffecbce17d6 Radio-Buttons to switch between query-modes: Probenliste und Probenplanung. Filter-Combobox store wird automatisch gewechselt. ToDo: Query-Store für Probenplanung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
15 displayFields: null,
3ffecbce17d6 Radio-Buttons to switch between query-modes: Probenliste und Probenplanung. Filter-Combobox store wird automatisch gewechselt. ToDo: Query-Store für Probenplanung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
16
749
78e73be45aaa Change store on radiobutton change for proben and messprogramm.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 747
diff changeset
17 requires: [
908
96e04c258b8f Fixed Code to correct minified js
Dustin Demuth <dustin@intevation.de>
parents: 837
diff changeset
18 'Lada.store.MessprogrammQueries',
975
fb99332bb48e Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents: 908
diff changeset
19 'Lada.store.ProbeQueries',
fb99332bb48e Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents: 908
diff changeset
20 'Lada.store.StammdatenQueries'
749
78e73be45aaa Change store on radiobutton change for proben and messprogramm.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 747
diff changeset
21 ],
78e73be45aaa Change store on radiobutton change for proben and messprogramm.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 747
diff changeset
22
747
3ffecbce17d6 Radio-Buttons to switch between query-modes: Probenliste und Probenplanung. Filter-Combobox store wird automatisch gewechselt. ToDo: Query-Store für Probenplanung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
23 /**
3ffecbce17d6 Radio-Buttons to switch between query-modes: Probenliste und Probenplanung. Filter-Combobox store wird automatisch gewechselt. ToDo: Query-Store für Probenplanung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
24 * Initialize this Controller
3ffecbce17d6 Radio-Buttons to switch between query-modes: Probenliste und Probenplanung. Filter-Combobox store wird automatisch gewechselt. ToDo: Query-Store für Probenplanung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
25 * It has 1 Listeners
978
7f5219b8e1bf Renamed the ProbePlanungSwitcher to a more generic ModeSwitcher and refactored the application
Dustin Demuth <dustin@intevation.de>
parents: 975
diff changeset
26 * A checked ModeSwithch-Radiofield fired a 'check'-event
747
3ffecbce17d6 Radio-Buttons to switch between query-modes: Probenliste und Probenplanung. Filter-Combobox store wird automatisch gewechselt. ToDo: Query-Store für Probenplanung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
27 */
3ffecbce17d6 Radio-Buttons to switch between query-modes: Probenliste und Probenplanung. Filter-Combobox store wird automatisch gewechselt. ToDo: Query-Store für Probenplanung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
28 init: function() {
3ffecbce17d6 Radio-Buttons to switch between query-modes: Probenliste und Probenplanung. Filter-Combobox store wird automatisch gewechselt. ToDo: Query-Store für Probenplanung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
29 this.control({
978
7f5219b8e1bf Renamed the ProbePlanungSwitcher to a more generic ModeSwitcher and refactored the application
Dustin Demuth <dustin@intevation.de>
parents: 975
diff changeset
30 'radiofield[name=modeswitch]': {
792
d572ee3271ac some work on a context-sensitive toolbar
Dustin Demuth <dustin@intevation.de>
parents: 752
diff changeset
31 check: this.switchModes
747
3ffecbce17d6 Radio-Buttons to switch between query-modes: Probenliste und Probenplanung. Filter-Combobox store wird automatisch gewechselt. ToDo: Query-Store für Probenplanung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
32 }
3ffecbce17d6 Radio-Buttons to switch between query-modes: Probenliste und Probenplanung. Filter-Combobox store wird automatisch gewechselt. ToDo: Query-Store für Probenplanung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
33 });
3ffecbce17d6 Radio-Buttons to switch between query-modes: Probenliste und Probenplanung. Filter-Combobox store wird automatisch gewechselt. ToDo: Query-Store für Probenplanung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
34 this.callParent(arguments);
3ffecbce17d6 Radio-Buttons to switch between query-modes: Probenliste und Probenplanung. Filter-Combobox store wird automatisch gewechselt. ToDo: Query-Store für Probenplanung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
35 },
3ffecbce17d6 Radio-Buttons to switch between query-modes: Probenliste und Probenplanung. Filter-Combobox store wird automatisch gewechselt. ToDo: Query-Store für Probenplanung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
36
3ffecbce17d6 Radio-Buttons to switch between query-modes: Probenliste und Probenplanung. Filter-Combobox store wird automatisch gewechselt. ToDo: Query-Store für Probenplanung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
37 /**
3ffecbce17d6 Radio-Buttons to switch between query-modes: Probenliste und Probenplanung. Filter-Combobox store wird automatisch gewechselt. ToDo: Query-Store für Probenplanung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
38 * Function is called when the user selects a checkbox.
3ffecbce17d6 Radio-Buttons to switch between query-modes: Probenliste und Probenplanung. Filter-Combobox store wird automatisch gewechselt. ToDo: Query-Store für Probenplanung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
39 * according to the checkboxes inputValue,
3ffecbce17d6 Radio-Buttons to switch between query-modes: Probenliste und Probenplanung. Filter-Combobox store wird automatisch gewechselt. ToDo: Query-Store für Probenplanung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
40 * the function alters the store which was loaded by the
792
d572ee3271ac some work on a context-sensitive toolbar
Dustin Demuth <dustin@intevation.de>
parents: 752
diff changeset
41 * filterpanels combobox,
747
3ffecbce17d6 Radio-Buttons to switch between query-modes: Probenliste und Probenplanung. Filter-Combobox store wird automatisch gewechselt. ToDo: Query-Store für Probenplanung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
42 */
792
d572ee3271ac some work on a context-sensitive toolbar
Dustin Demuth <dustin@intevation.de>
parents: 752
diff changeset
43 switchModes: function(field) {
978
7f5219b8e1bf Renamed the ProbePlanungSwitcher to a more generic ModeSwitcher and refactored the application
Dustin Demuth <dustin@intevation.de>
parents: 975
diff changeset
44 var cbox = field.up('modeswitcher').up().down('combobox');
752
639e82e2089e remove and hide filters when switching between modes
Dustin Demuth <dustin@intevation.de>
parents: 751
diff changeset
45 filters = field.up('panel[name=main]').down('fieldset[name=filtervariables]');
639e82e2089e remove and hide filters when switching between modes
Dustin Demuth <dustin@intevation.de>
parents: 751
diff changeset
46 filters.removeAll();
639e82e2089e remove and hide filters when switching between modes
Dustin Demuth <dustin@intevation.de>
parents: 751
diff changeset
47 filters.hide();
975
fb99332bb48e Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents: 908
diff changeset
48
fb99332bb48e Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents: 908
diff changeset
49 //Initialise variables which will define the querystore
fb99332bb48e Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents: 908
diff changeset
50 // and the store which has to be loaded into the grid.
fb99332bb48e Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents: 908
diff changeset
51 var querystorename = '';
fb99332bb48e Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents: 908
diff changeset
52
fb99332bb48e Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents: 908
diff changeset
53 // In dependence of the checkboxes input value,
fb99332bb48e Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents: 908
diff changeset
54 // define the store of the filter.
fb99332bb48e Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents: 908
diff changeset
55 // app/controller/Filter.js contains similar code.
fb99332bb48e Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents: 908
diff changeset
56 if (field.inputValue === 'messprogramme' && cbox) {
fb99332bb48e Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents: 908
diff changeset
57 querystorename = 'Lada.store.MessprogrammQueries';
747
3ffecbce17d6 Radio-Buttons to switch between query-modes: Probenliste und Probenplanung. Filter-Combobox store wird automatisch gewechselt. ToDo: Query-Store für Probenplanung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
58 }
975
fb99332bb48e Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents: 908
diff changeset
59 else if (field.inputValue === 'proben' && cbox) {
fb99332bb48e Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents: 908
diff changeset
60 querystorename = 'Lada.store.ProbeQueries';
fb99332bb48e Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents: 908
diff changeset
61 }
fb99332bb48e Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents: 908
diff changeset
62 else if (field.inputValue === 'stammdaten' && cbox) {
fb99332bb48e Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents: 908
diff changeset
63 querystorename = 'Lada.store.StammdatenQueries';
747
3ffecbce17d6 Radio-Buttons to switch between query-modes: Probenliste und Probenplanung. Filter-Combobox store wird automatisch gewechselt. ToDo: Query-Store für Probenplanung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
64 }
3ffecbce17d6 Radio-Buttons to switch between query-modes: Probenliste und Probenplanung. Filter-Combobox store wird automatisch gewechselt. ToDo: Query-Store für Probenplanung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
65
975
fb99332bb48e Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents: 908
diff changeset
66 if (querystorename) {
fb99332bb48e Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents: 908
diff changeset
67 var store = Ext.StoreManager.lookup(querystorename);
837
d054732bc7a2 Switch the Mode of the Filterresultgrid according to the selection of the radio buttons in the probenplanungswitcher
Dustin Demuth <dustin@intevation.de>
parents: 795
diff changeset
68
975
fb99332bb48e Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents: 908
diff changeset
69 if (!store) {
fb99332bb48e Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents: 908
diff changeset
70 store = Ext.create(querystorename, {
fb99332bb48e Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents: 908
diff changeset
71 //Select first Item on Load
fb99332bb48e Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents: 908
diff changeset
72 listeners: {
fb99332bb48e Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents: 908
diff changeset
73 load: function(store){
fb99332bb48e Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents: 908
diff changeset
74 var records = new Array();
fb99332bb48e Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents: 908
diff changeset
75 records.push(store.getAt(0));
795
255568e97c96 Latest commit broke the search function
Dustin Demuth <dustin@intevation.de>
parents: 794
diff changeset
76
975
fb99332bb48e Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents: 908
diff changeset
77 cbox.select(records[0]);
fb99332bb48e Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents: 908
diff changeset
78 cbox.fireEvent('select', cbox, records);
fb99332bb48e Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents: 908
diff changeset
79 }
794
bc6bc71efb78 Preselect Proben in PPS, Preselect the first entry in the Filter Combobox
Dustin Demuth <dustin@intevation.de>
parents: 792
diff changeset
80 }
975
fb99332bb48e Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents: 908
diff changeset
81 });
fb99332bb48e Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents: 908
diff changeset
82 }
fb99332bb48e Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents: 908
diff changeset
83
fb99332bb48e Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents: 908
diff changeset
84 if (store) {
fb99332bb48e Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents: 908
diff changeset
85 if (!store.autoLoad) {
fb99332bb48e Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents: 908
diff changeset
86 store.load();
794
bc6bc71efb78 Preselect Proben in PPS, Preselect the first entry in the Filter Combobox
Dustin Demuth <dustin@intevation.de>
parents: 792
diff changeset
87 }
975
fb99332bb48e Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents: 908
diff changeset
88 //cbox.reset();
fb99332bb48e Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents: 908
diff changeset
89 cbox.bindStore(store);
fb99332bb48e Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents: 908
diff changeset
90 }
747
3ffecbce17d6 Radio-Buttons to switch between query-modes: Probenliste und Probenplanung. Filter-Combobox store wird automatisch gewechselt. ToDo: Query-Store für Probenplanung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
91 }
3ffecbce17d6 Radio-Buttons to switch between query-modes: Probenliste und Probenplanung. Filter-Combobox store wird automatisch gewechselt. ToDo: Query-Store für Probenplanung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
92 }
3ffecbce17d6 Radio-Buttons to switch between query-modes: Probenliste und Probenplanung. Filter-Combobox store wird automatisch gewechselt. ToDo: Query-Store für Probenplanung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
93 });

http://lada.wald.intevation.org