Mercurial > lada > lada-client
annotate app/controller/ProbenPlanungSwitcher.js @ 911:d87fa81eca85
Updated resources path for FileSaver.js and Blob.js
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Tue, 11 Aug 2015 13:29:51 +0200 |
parents | 96e04c258b8f |
children | fb99332bb48e |
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: [ |
908
96e04c258b8f
Fixed Code to correct minified js
Dustin Demuth <dustin@intevation.de>
parents:
837
diff
changeset
|
18 'Lada.store.MessprogrammQueries', |
96e04c258b8f
Fixed Code to correct minified js
Dustin Demuth <dustin@intevation.de>
parents:
837
diff
changeset
|
19 'Lada.store.ProbeQueries' |
749
78e73be45aaa
Change store on radiobutton change for proben and messprogramm.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
747
diff
changeset
|
20 ], |
78e73be45aaa
Change store on radiobutton change for proben and messprogramm.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
747
diff
changeset
|
21 |
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
|
22 /** |
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 * 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
|
24 * 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
|
25 * 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
|
26 */ |
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 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
|
28 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
|
29 'radiofield[name=ppswitch]': { |
792
d572ee3271ac
some work on a context-sensitive toolbar
Dustin Demuth <dustin@intevation.de>
parents:
752
diff
changeset
|
30 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
|
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 }); |
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 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
|
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 /** |
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 * 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
|
38 * 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
|
39 * 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
|
40 * filterpanels combobox, |
d572ee3271ac
some work on a context-sensitive toolbar
Dustin Demuth <dustin@intevation.de>
parents:
752
diff
changeset
|
41 * 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
|
42 * 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
|
43 */ |
792
d572ee3271ac
some work on a context-sensitive toolbar
Dustin Demuth <dustin@intevation.de>
parents:
752
diff
changeset
|
44 switchModes: function(field) { |
d572ee3271ac
some work on a context-sensitive toolbar
Dustin Demuth <dustin@intevation.de>
parents:
752
diff
changeset
|
45 |
d572ee3271ac
some work on a context-sensitive toolbar
Dustin Demuth <dustin@intevation.de>
parents:
752
diff
changeset
|
46 var disableButtons = true; |
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'; |
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
|
53 var gridsname = 'Lada.store.ProbenList'; |
792
d572ee3271ac
some work on a context-sensitive toolbar
Dustin Demuth <dustin@intevation.de>
parents:
752
diff
changeset
|
54 if (field.inputValue === 'MessprogrammList' && cbox) { |
750
561ade69980e
reset combobox when the store was switched
Dustin Demuth <dustin@intevation.de>
parents:
749
diff
changeset
|
55 sname = 'Lada.store.MessprogrammQueries'; |
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
|
56 gridsname = 'Lada.store.MessprogrammeList'; |
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
|
57 } |
792
d572ee3271ac
some work on a context-sensitive toolbar
Dustin Demuth <dustin@intevation.de>
parents:
752
diff
changeset
|
58 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
|
59 sname = 'Lada.store.ProbeQueries'; |
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
|
60 gridsname = 'Lada.store.ProbenList'; |
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 } |
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 |
792
d572ee3271ac
some work on a context-sensitive toolbar
Dustin Demuth <dustin@intevation.de>
parents:
752
diff
changeset
|
63 |
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 var store = Ext.StoreManager.lookup(sname); |
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
|
65 |
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
|
66 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
|
67 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
|
68 //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
|
69 listeners: { |
bc6bc71efb78
Preselect Proben in PPS, Preselect the first entry in the Filter Combobox
Dustin Demuth <dustin@intevation.de>
parents:
792
diff
changeset
|
70 load: function(s){ |
795
255568e97c96
Latest commit broke the search function
Dustin Demuth <dustin@intevation.de>
parents:
794
diff
changeset
|
71 var records = new Array(); |
255568e97c96
Latest commit broke the search function
Dustin Demuth <dustin@intevation.de>
parents:
794
diff
changeset
|
72 records.push(store.getAt(0)); |
255568e97c96
Latest commit broke the search function
Dustin Demuth <dustin@intevation.de>
parents:
794
diff
changeset
|
73 |
255568e97c96
Latest commit broke the search function
Dustin Demuth <dustin@intevation.de>
parents:
794
diff
changeset
|
74 cbox.select(records[0]); |
255568e97c96
Latest commit broke the search function
Dustin Demuth <dustin@intevation.de>
parents:
794
diff
changeset
|
75 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
|
76 } |
bc6bc71efb78
Preselect Proben in PPS, Preselect the first entry in the Filter Combobox
Dustin Demuth <dustin@intevation.de>
parents:
792
diff
changeset
|
77 } |
bc6bc71efb78
Preselect Proben in PPS, Preselect the first entry in the Filter Combobox
Dustin Demuth <dustin@intevation.de>
parents:
792
diff
changeset
|
78 }); |
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 } |
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 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
|
81 store.load(); |
750
561ade69980e
reset combobox when the store was switched
Dustin Demuth <dustin@intevation.de>
parents:
749
diff
changeset
|
82 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
|
83 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
|
84 } |
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
|
85 |
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
|
86 var gridstore = Ext.StoreManager.lookup(gridsname); |
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
|
87 if (!gridstore) { |
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
|
88 gridstore = Ext.create(gridsname); |
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
|
89 } |
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
|
90 if (gridstore) { |
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
|
91 resultGrid.setStore(gridstore); |
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
|
92 resultGrid.show(); |
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
|
93 } |
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
|
94 |
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
|
95 } |
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
|
96 }); |