annotate app/controller/ProbenPlanungSwitcher.js @ 835:de63d8b4926a

Added tag 2.0.1 for changeset 2214aea9fd3a
author Raimund Renkert <raimund.renkert@intevation.de>
date Tue, 16 Jun 2015 10:30:33 +0200
parents 255568e97c96
children d054732bc7a2
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 /**
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
10 * Controller for the ProbenPlanungSwitcher
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
11 * This controller handles all logic related to the PPS
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 */
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
13 Ext.define('Lada.controller.ProbenPlanungSwitcher', {
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: [
78e73be45aaa Change store on radiobutton change for proben and messprogramm.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 747
diff changeset
18 'Lada.store.MessprogrammQueries'
78e73be45aaa Change store on radiobutton change for proben and messprogramm.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 747
diff changeset
19 ],
78e73be45aaa Change store on radiobutton change for proben and messprogramm.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 747
diff changeset
20
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
21 /**
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
22 * 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
23 * It has 1 Listeners
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 * A checked PPS-Radiofield fired a 'check'-event
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 */
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
26 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
27 this.control({
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 'radiofield[name=ppswitch]': {
792
d572ee3271ac some work on a context-sensitive toolbar
Dustin Demuth <dustin@intevation.de>
parents: 752
diff changeset
29 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
30 }
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
31 });
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 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
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
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 * 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
37 * 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
38 * 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
39 * filterpanels combobox,
d572ee3271ac some work on a context-sensitive toolbar
Dustin Demuth <dustin@intevation.de>
parents: 752
diff changeset
40 * If enabled the function also disables / enables the UI-Buttons
d572ee3271ac some work on a context-sensitive toolbar
Dustin Demuth <dustin@intevation.de>
parents: 752
diff changeset
41 * in the Filterresult grid.
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) {
d572ee3271ac some work on a context-sensitive toolbar
Dustin Demuth <dustin@intevation.de>
parents: 752
diff changeset
44
d572ee3271ac some work on a context-sensitive toolbar
Dustin Demuth <dustin@intevation.de>
parents: 752
diff changeset
45 var disableButtons = true;
d572ee3271ac some work on a context-sensitive toolbar
Dustin Demuth <dustin@intevation.de>
parents: 752
diff changeset
46
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
47 var cbox = field.up('probenplanungswitcher').up().down('combobox');
749
78e73be45aaa Change store on radiobutton change for proben and messprogramm.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 747
diff changeset
48 var resultGrid = field.up('panel[name=main]').down('filterresultgrid');
752
639e82e2089e remove and hide filters when switching between modes
Dustin Demuth <dustin@intevation.de>
parents: 751
diff changeset
49 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
50 filters.removeAll();
639e82e2089e remove and hide filters when switching between modes
Dustin Demuth <dustin@intevation.de>
parents: 751
diff changeset
51 filters.hide();
749
78e73be45aaa Change store on radiobutton change for proben and messprogramm.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 747
diff changeset
52 var sname = 'Lada.store.ProbeQueries';
792
d572ee3271ac some work on a context-sensitive toolbar
Dustin Demuth <dustin@intevation.de>
parents: 752
diff changeset
53 if (field.inputValue === 'MessprogrammList' && cbox) {
750
561ade69980e reset combobox when the store was switched
Dustin Demuth <dustin@intevation.de>
parents: 749
diff changeset
54 sname = '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
55 }
792
d572ee3271ac some work on a context-sensitive toolbar
Dustin Demuth <dustin@intevation.de>
parents: 752
diff changeset
56 else if (field.inputValue === 'ProbeList' && cbox) {
749
78e73be45aaa Change store on radiobutton change for proben and messprogramm.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 747
diff changeset
57 sname = 'Lada.store.ProbeQueries';
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 }
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
59
792
d572ee3271ac some work on a context-sensitive toolbar
Dustin Demuth <dustin@intevation.de>
parents: 752
diff changeset
60
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
61 var store = Ext.StoreManager.lookup(sname);
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
62 if (!store) {
794
bc6bc71efb78 Preselect Proben in PPS, Preselect the first entry in the Filter Combobox
Dustin Demuth <dustin@intevation.de>
parents: 792
diff changeset
63 store = Ext.create(sname, {
bc6bc71efb78 Preselect Proben in PPS, Preselect the first entry in the Filter Combobox
Dustin Demuth <dustin@intevation.de>
parents: 792
diff changeset
64 //Select first Item on Load
bc6bc71efb78 Preselect Proben in PPS, Preselect the first entry in the Filter Combobox
Dustin Demuth <dustin@intevation.de>
parents: 792
diff changeset
65 listeners: {
bc6bc71efb78 Preselect Proben in PPS, Preselect the first entry in the Filter Combobox
Dustin Demuth <dustin@intevation.de>
parents: 792
diff changeset
66 load: function(s){
795
255568e97c96 Latest commit broke the search function
Dustin Demuth <dustin@intevation.de>
parents: 794
diff changeset
67 var records = new Array();
255568e97c96 Latest commit broke the search function
Dustin Demuth <dustin@intevation.de>
parents: 794
diff changeset
68 records.push(store.getAt(0));
255568e97c96 Latest commit broke the search function
Dustin Demuth <dustin@intevation.de>
parents: 794
diff changeset
69
255568e97c96 Latest commit broke the search function
Dustin Demuth <dustin@intevation.de>
parents: 794
diff changeset
70 cbox.select(records[0]);
255568e97c96 Latest commit broke the search function
Dustin Demuth <dustin@intevation.de>
parents: 794
diff changeset
71 cbox.fireEvent('select', cbox, records);
794
bc6bc71efb78 Preselect Proben in PPS, Preselect the first entry in the Filter Combobox
Dustin Demuth <dustin@intevation.de>
parents: 792
diff changeset
72 }
bc6bc71efb78 Preselect Proben in PPS, Preselect the first entry in the Filter Combobox
Dustin Demuth <dustin@intevation.de>
parents: 792
diff changeset
73 }
bc6bc71efb78 Preselect Proben in PPS, Preselect the first entry in the Filter Combobox
Dustin Demuth <dustin@intevation.de>
parents: 792
diff changeset
74 });
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
75 }
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
76 if (store) {
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
77 store.load();
750
561ade69980e reset combobox when the store was switched
Dustin Demuth <dustin@intevation.de>
parents: 749
diff changeset
78 cbox.reset();
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
79 cbox.bindStore(store);
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
80 }
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
81 }
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
82 });

http://lada.wald.intevation.org