Mercurial > lada > lada-client
annotate app/controller/Filter.js @ 1117:16cc342f1a68
Reverse result columns only if they have the wrong order.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Mon, 23 May 2016 11:38:55 +0200 |
parents | 566976d72ce5 |
children | 0b908138a740 |
rev | line source |
---|---|
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
2 * Software engineering by Intevation GmbH |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
3 * |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
4 * This file is Free Software under the GNU GPL (v>=3) |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
6 * the documentation coming with IMIS-Labordaten-Application for details. |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
7 */ |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
8 |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
9 /** |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
10 * Controller for the Filter |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
11 * This controller handles all logic related to the filter |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
12 */ |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
13 Ext.define('Lada.controller.Filter', { |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
14 extend: 'Ext.app.Controller', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
15 |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
16 requires: [ |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
17 'Lada.view.widget.Messstelle', |
1051
981339d774b8
merged stammdatengrids to default.
Raimund Renkert <raimund.renkert@intevation.de>
diff
changeset
|
18 'Lada.view.grid.MessprogrammeList', |
981339d774b8
merged stammdatengrids to default.
Raimund Renkert <raimund.renkert@intevation.de>
diff
changeset
|
19 'Lada.view.grid.ProbeList', |
1077
2a5d42045c63
Display Messungen query mode and use the new messung list grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1063
diff
changeset
|
20 'Lada.view.grid.MessungList', |
2a5d42045c63
Display Messungen query mode and use the new messung list grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1063
diff
changeset
|
21 'Lada.store.MessungenList', |
1015
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1008
diff
changeset
|
22 'Lada.view.window.FilterManagement', |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
23 'Lada.view.widget.Umwelt' |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
24 ], |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
25 |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
26 stores: [ |
908
96e04c258b8f
Fixed Code to correct minified js
Dustin Demuth <dustin@intevation.de>
parents:
882
diff
changeset
|
27 'ProbenList', // List of found Proben |
96e04c258b8f
Fixed Code to correct minified js
Dustin Demuth <dustin@intevation.de>
parents:
882
diff
changeset
|
28 'MessprogrammeList' //List of found Messprogramme |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
29 ], |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
30 |
734
2d482dfaa41a
Update list on search and reset filter values on reset button click.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
657
diff
changeset
|
31 displayFields: null, |
2d482dfaa41a
Update list on search and reset filter values on reset button click.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
657
diff
changeset
|
32 |
1015
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1008
diff
changeset
|
33 managementWindow: null, |
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1008
diff
changeset
|
34 |
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1008
diff
changeset
|
35 mode: 'proben', |
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1008
diff
changeset
|
36 |
742
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
734
diff
changeset
|
37 /** |
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
734
diff
changeset
|
38 * Initialize this Controller |
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
734
diff
changeset
|
39 * It has 4 Listeners |
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
734
diff
changeset
|
40 */ |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
41 init: function() { |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
42 this.control({ |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
43 // CSS like selector to select element in the viewport. See |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
44 // ComponentQuery documentation for more details. |
994
092e245b13a4
draft implementation of the status-reset function: Todo: move this into a 'confirmation dialog'
Dustin Demuth <dustin@intevation.de>
parents:
908
diff
changeset
|
45 'filterpanel combobox[name=filter]': { |
794
bc6bc71efb78
Preselect Proben in PPS, Preselect the first entry in the Filter Combobox
Dustin Demuth <dustin@intevation.de>
parents:
792
diff
changeset
|
46 // Map Select event |
882 | 47 select: this.selectSql |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
48 }, |
994
092e245b13a4
draft implementation of the status-reset function: Todo: move this into a 'confirmation dialog'
Dustin Demuth <dustin@intevation.de>
parents:
908
diff
changeset
|
49 'filterpanel button[action=search]': { |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
50 // Map click event on Button. |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
51 click: this.search |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
52 }, |
994
092e245b13a4
draft implementation of the status-reset function: Todo: move this into a 'confirmation dialog'
Dustin Demuth <dustin@intevation.de>
parents:
908
diff
changeset
|
53 'filterpanel button[action=reset]': { |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
54 // Map click event on Button. |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
55 click: this.reset |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
56 }, |
1016
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
57 'filterpanel button[action=details]': { |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
58 click: this.showDetails |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
59 }, |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
60 'filterpanel button[action=manage]': { |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
61 click: this.showManagement |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
62 }, |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
63 'filterpanel checkbox[name=favorites]': { |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
64 change: this.triggerFilterUpdate |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
65 }, |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
66 'filterpanel button[action=savedefault]': { |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
67 click: this.saveFilterDefaults |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
68 }, |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
69 'filterpanel button[action=resetdefault]': { |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
70 click: this.resetFilterDefaults |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
71 }, |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
72 'menuitem[action=about]': { |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
73 // Map click event on Button. |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
74 click: this.about |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
75 } |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
76 }); |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
77 this.callParent(arguments); |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
78 }, |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
79 |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
80 /** |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
81 * Function called when the user selects a SQL query in the dropdownlist. |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
82 * The function will hide/display additional element related to the |
975
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
908
diff
changeset
|
83 * selected search query. |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
908
diff
changeset
|
84 * It also replaces the Store of the Filteresultgrid. |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
908
diff
changeset
|
85 * Two possibilities exist to do so: Proben/Messprogramme where dynamic columns exist, but the |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
908
diff
changeset
|
86 * content remains of the same type and Stammdaten, were columns are fixed but the type might |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
908
diff
changeset
|
87 * vary between orte, kategorien, ... |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
88 */ |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
89 selectSql: function(element, record) { |
1016
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
90 var filters = element.up('panel[name=main]').down('panel[name=filtervariables]'); |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
91 var filterValues = element.up('panel[name=main]').down('panel[name=filtervalues]'); |
979 | 92 |
1043
91f65b9cc2fb
Uncheck favorites if no favorite entries exist.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1042
diff
changeset
|
93 var desc = element.up('fieldset').down('displayfield[name=description]'); |
1015
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1008
diff
changeset
|
94 if (!record[0]) { |
1043
91f65b9cc2fb
Uncheck favorites if no favorite entries exist.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1042
diff
changeset
|
95 desc.setValue(''); |
1015
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1008
diff
changeset
|
96 return; |
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1008
diff
changeset
|
97 } |
979 | 98 // Set "Filter Auswahl" Description |
99 desc.setValue(record[0].data.description); | |
100 | |
734
2d482dfaa41a
Update list on search and reset filter values on reset button click.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
657
diff
changeset
|
101 this.displayFields = record[0].data.results; |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
102 var filterFields = record[0].data.filters; |
975
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
908
diff
changeset
|
103 var contentPanel = element.up('panel[name=main]').down('panel[name=contentpanel]'); |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
908
diff
changeset
|
104 var queryType = record[0].get('type'); //The type of the query, might be proben, messprogramme, |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
908
diff
changeset
|
105 // or a stammdatendtype |
1015
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1008
diff
changeset
|
106 var details = element.up('panel[name=main]').down('filterdetails'); |
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1008
diff
changeset
|
107 details.setRecord(record[0]); |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
108 |
734
2d482dfaa41a
Update list on search and reset filter values on reset button click.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
657
diff
changeset
|
109 this.reset(element); |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
110 |
979 | 111 contentPanel.removeAll(); //clear the panel: make space for new grids |
112 | |
113 // Setup Columns | |
1117
16cc342f1a68
Reverse result columns only if they have the wrong order.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1113
diff
changeset
|
114 if (this.displayFields && this.displayFields[0].index === 0) { |
979 | 115 this.displayFields.reverse(); |
116 } | |
975
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
908
diff
changeset
|
117 |
1077
2a5d42045c63
Display Messungen query mode and use the new messung list grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1063
diff
changeset
|
118 if (queryType == 'probe' || |
2a5d42045c63
Display Messungen query mode and use the new messung list grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1063
diff
changeset
|
119 queryType == 'messung' || |
2a5d42045c63
Display Messungen query mode and use the new messung list grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1063
diff
changeset
|
120 queryType == 'messprogramm') { |
979 | 121 // Dynamic Grids |
122 // We need to set both grid and Store. | |
975
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
908
diff
changeset
|
123 var frgrid; // The Resultgrid |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
908
diff
changeset
|
124 var gridstore; // The Store which will be used in the resultgrid. |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
908
diff
changeset
|
125 |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
908
diff
changeset
|
126 switch (queryType) { |
981
2c394e72ba41
Use the lada-server for stammdatenqueries.
Dustin Demuth <dustin@intevation.de>
parents:
979
diff
changeset
|
127 case 'probe': |
975
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
908
diff
changeset
|
128 gridstore = Ext.create('Lada.store.ProbenList'); |
1111
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1077
diff
changeset
|
129 frgrid = Ext.create('Lada.view.grid.ProbeList', { |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1077
diff
changeset
|
130 plugins: [{ |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1077
diff
changeset
|
131 ptype: 'gridrowexpander', |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1077
diff
changeset
|
132 gridType: 'Lada.view.grid.Messung', |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1077
diff
changeset
|
133 gridConfig: { |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1077
diff
changeset
|
134 bottomBar: false |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1077
diff
changeset
|
135 } |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1077
diff
changeset
|
136 }] |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1077
diff
changeset
|
137 }); |
975
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
908
diff
changeset
|
138 break; |
1077
2a5d42045c63
Display Messungen query mode and use the new messung list grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1063
diff
changeset
|
139 case 'messung': |
2a5d42045c63
Display Messungen query mode and use the new messung list grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1063
diff
changeset
|
140 gridstore = Ext.create('Lada.store.MessungenList'); |
1112
e76551a6da27
Use custom row expander in messung list grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1111
diff
changeset
|
141 frgrid = Ext.create('Lada.view.grid.MessungList', { |
e76551a6da27
Use custom row expander in messung list grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1111
diff
changeset
|
142 plugins: [{ |
e76551a6da27
Use custom row expander in messung list grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1111
diff
changeset
|
143 ptype: 'gridrowexpander', |
e76551a6da27
Use custom row expander in messung list grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1111
diff
changeset
|
144 gridType: 'Lada.view.grid.Messwert', |
e76551a6da27
Use custom row expander in messung list grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1111
diff
changeset
|
145 gridConfig: { |
e76551a6da27
Use custom row expander in messung list grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1111
diff
changeset
|
146 bottomBar: false |
e76551a6da27
Use custom row expander in messung list grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1111
diff
changeset
|
147 } |
e76551a6da27
Use custom row expander in messung list grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1111
diff
changeset
|
148 }] |
e76551a6da27
Use custom row expander in messung list grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1111
diff
changeset
|
149 }); |
1077
2a5d42045c63
Display Messungen query mode and use the new messung list grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1063
diff
changeset
|
150 break; |
981
2c394e72ba41
Use the lada-server for stammdatenqueries.
Dustin Demuth <dustin@intevation.de>
parents:
979
diff
changeset
|
151 case 'messprogramm': |
975
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
908
diff
changeset
|
152 gridstore = Ext.create('Lada.store.MessprogrammeList'); |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
908
diff
changeset
|
153 frgrid = Ext.create('Lada.view.grid.MessprogrammeList'); |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
908
diff
changeset
|
154 break; |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
908
diff
changeset
|
155 } |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
908
diff
changeset
|
156 |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
908
diff
changeset
|
157 if (gridstore) { |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
908
diff
changeset
|
158 frgrid.setStore(gridstore); |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
908
diff
changeset
|
159 } |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
908
diff
changeset
|
160 |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
908
diff
changeset
|
161 contentPanel.add(frgrid); |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
162 } |
975
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
908
diff
changeset
|
163 else { |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
908
diff
changeset
|
164 // Grids which are not build with dynamic columns |
979 | 165 // The store is configured in each grid, hence we only need to set the |
166 // grid | |
975
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
908
diff
changeset
|
167 var resultGrid; |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
908
diff
changeset
|
168 switch (queryType) { |
981
2c394e72ba41
Use the lada-server for stammdatenqueries.
Dustin Demuth <dustin@intevation.de>
parents:
979
diff
changeset
|
169 case 'messprogrammkategorie': |
975
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
908
diff
changeset
|
170 resultGrid = Ext.create('Lada.view.grid.MessprogrammKategorie'); |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
908
diff
changeset
|
171 break; |
981
2c394e72ba41
Use the lada-server for stammdatenqueries.
Dustin Demuth <dustin@intevation.de>
parents:
979
diff
changeset
|
172 case 'datensatzerzeuger': |
975
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
908
diff
changeset
|
173 resultGrid = Ext.create('Lada.view.grid.DatensatzErzeuger'); |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
908
diff
changeset
|
174 break; |
981
2c394e72ba41
Use the lada-server for stammdatenqueries.
Dustin Demuth <dustin@intevation.de>
parents:
979
diff
changeset
|
175 case 'ort': |
1021
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1004
diff
changeset
|
176 resultGrid = Ext.create('Lada.view.panel.Ort'); |
981
2c394e72ba41
Use the lada-server for stammdatenqueries.
Dustin Demuth <dustin@intevation.de>
parents:
979
diff
changeset
|
177 break; |
2c394e72ba41
Use the lada-server for stammdatenqueries.
Dustin Demuth <dustin@intevation.de>
parents:
979
diff
changeset
|
178 case 'probenehmer': |
2c394e72ba41
Use the lada-server for stammdatenqueries.
Dustin Demuth <dustin@intevation.de>
parents:
979
diff
changeset
|
179 resultGrid = Ext.create('Lada.view.grid.Probenehmer'); |
2c394e72ba41
Use the lada-server for stammdatenqueries.
Dustin Demuth <dustin@intevation.de>
parents:
979
diff
changeset
|
180 break; |
975
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
908
diff
changeset
|
181 } |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
908
diff
changeset
|
182 if (resultGrid) { |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
908
diff
changeset
|
183 contentPanel.add(resultGrid); |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
908
diff
changeset
|
184 } |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
908
diff
changeset
|
185 } |
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
908
diff
changeset
|
186 /* Setup Filters |
742
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
734
diff
changeset
|
187 * |
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
734
diff
changeset
|
188 * Allowed types are |
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
734
diff
changeset
|
189 * * text |
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
734
diff
changeset
|
190 * * number |
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
734
diff
changeset
|
191 * * datetime |
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
734
diff
changeset
|
192 * * bool |
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
734
diff
changeset
|
193 * * listmst |
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
734
diff
changeset
|
194 * * listumw |
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
734
diff
changeset
|
195 * * listver |
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
734
diff
changeset
|
196 * * listdbasis |
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
734
diff
changeset
|
197 * * listnetz |
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
734
diff
changeset
|
198 * |
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
734
diff
changeset
|
199 * Iterate over all configured filters and add filters dynamically |
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
734
diff
changeset
|
200 * |
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
734
diff
changeset
|
201 * 1. Empty filters |
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
734
diff
changeset
|
202 */ |
1016
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
203 filterValues.removeAll(); |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
204 var hide = true; |
742
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
734
diff
changeset
|
205 /* 2. Iterate over all configured filters */ |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
206 var j; |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
207 for (j = 0; j < filterFields.length; j++) { |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
208 var type = filterFields[j].type; |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
209 var name = filterFields[j].dataIndex; |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
210 var label = filterFields[j].label; |
1056
239e0ebb97e0
Fixed typo in filter creation.^
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1051
diff
changeset
|
211 var multi = filterFields[j].multiselect; |
1016
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
212 var filterId = filterFields[j].id; |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
213 var field = null; |
1016
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
214 var value = filterFields[j].value; |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
215 if (type === 'text') { |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
216 field = Ext.create('Ext.form.field.Text', { |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
217 name: name, |
1016
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
218 fieldLabel: label, |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
219 filterId: filterId, |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
220 value: value |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
221 }); |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
222 } |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
223 else if (type === 'number') { |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
224 field = Ext.create('Ext.form.field.Number', { |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
225 name: name, |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
226 labelWidth: 135, |
1016
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
227 fieldLabel: label, |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
228 filterId: filterId, |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
229 value: value |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
230 }); |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
231 } |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
232 else if (type === 'datetime') { |
575
54dbb6c44ca6
Fixed filter widget creation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
233 field = Ext.create('Lada.view.widget.Datetime', { |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
234 name: name, |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
235 labelWidth: 135, |
1016
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
236 fieldLabel: label, |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
237 filterId: filterId, |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
238 value: value |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
239 }); |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
240 } |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
241 else if (type === 'bool') { |
575
54dbb6c44ca6
Fixed filter widget creation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
242 field = Ext.create('Lada.view.widget.Testdatensatz', { |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
243 name: name, |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
244 labelWidth: 135, |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
245 fieldLabel: label, |
1016
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
246 value: value, |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
247 filterId: filterId, |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
248 emptyText: '' |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
249 }); |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
250 } |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
251 else if (type === 'listmst') { |
575
54dbb6c44ca6
Fixed filter widget creation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
252 field = Ext.create('Lada.view.widget.Messstelle', { |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
253 name: name, |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
254 labelWidth: 135, |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
255 fieldLabel: label, |
1016
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
256 multiSelect: multi, |
1063
4654b788f3d4
Allow empty filter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1056
diff
changeset
|
257 forceSelection: false, |
1016
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
258 filterId: filterId, |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
259 value: value |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
260 }); |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
261 } |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
262 else if (type === 'listumw') { |
575
54dbb6c44ca6
Fixed filter widget creation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
263 field = Ext.create('Lada.view.widget.Umwelt', { |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
264 name: name, |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
265 labelWidth: 135, |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
266 fieldLabel: label, |
1016
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
267 value: value, |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
268 filterId: filterId, |
1063
4654b788f3d4
Allow empty filter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1056
diff
changeset
|
269 forceSelection: false, |
874
031b4431b1b8
Applied Patch which was presented in the Workshop: Umweltbereich ComboBox in shall not show the name of the umweltbereich
Dustin Demuth <dustin@intevation.de>
parents:
844
diff
changeset
|
270 multiSelect: multi, |
031b4431b1b8
Applied Patch which was presented in the Workshop: Umweltbereich ComboBox in shall not show the name of the umweltbereich
Dustin Demuth <dustin@intevation.de>
parents:
844
diff
changeset
|
271 displayTpl: Ext.create('Ext.XTemplate', |
031b4431b1b8
Applied Patch which was presented in the Workshop: Umweltbereich ComboBox in shall not show the name of the umweltbereich
Dustin Demuth <dustin@intevation.de>
parents:
844
diff
changeset
|
272 '<tpl for=".">{id} </tpl>') |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
273 }); |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
274 } |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
275 else if (type === 'listdbasis') { |
575
54dbb6c44ca6
Fixed filter widget creation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
276 field = Ext.create('Lada.view.widget.Datenbasis', { |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
277 name: name, |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
278 labelWidth: 135, |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
279 fieldLabel: label, |
1063
4654b788f3d4
Allow empty filter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1056
diff
changeset
|
280 forceSelection: false, |
1016
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
281 value: value, |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
282 filterId: filterId, |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
283 multiSelect: multi |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
284 }); |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
285 } |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
286 else if (type === 'listver') { |
575
54dbb6c44ca6
Fixed filter widget creation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
287 field = Ext.create('Lada.view.widget.Verwaltungseinheit', { |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
288 name: name, |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
289 labelWidth: 135, |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
290 fieldLabel: label, |
1063
4654b788f3d4
Allow empty filter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1056
diff
changeset
|
291 forceSelection: false, |
1016
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
292 value: value, |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
293 filterId: filterId, |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
294 multiSelect: multi |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
295 }); |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
296 } |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
297 else if (type === 'listnetz') { |
575
54dbb6c44ca6
Fixed filter widget creation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
298 field = Ext.create('Lada.view.widget.Netzbetreiber', { |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
299 name: name, |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
300 labelWidth: 135, |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
301 fieldLabel: label, |
1063
4654b788f3d4
Allow empty filter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1056
diff
changeset
|
302 forceSelection: false, |
1016
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
303 value: value, |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
304 filterId: filterId, |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
305 multiSelect: multi |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
306 }); |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
307 } |
1106
ecce10cf32dc
add stus filter to messungs query
Michael Stanko <mstanko@bfs.de>
parents:
1077
diff
changeset
|
308 else if (type === 'liststatus') { |
ecce10cf32dc
add stus filter to messungs query
Michael Stanko <mstanko@bfs.de>
parents:
1077
diff
changeset
|
309 field = Ext.create('Lada.view.widget.Status', { |
ecce10cf32dc
add stus filter to messungs query
Michael Stanko <mstanko@bfs.de>
parents:
1077
diff
changeset
|
310 name: name, |
ecce10cf32dc
add stus filter to messungs query
Michael Stanko <mstanko@bfs.de>
parents:
1077
diff
changeset
|
311 labelWidth: 135, |
ecce10cf32dc
add stus filter to messungs query
Michael Stanko <mstanko@bfs.de>
parents:
1077
diff
changeset
|
312 fieldLabel: label, |
ecce10cf32dc
add stus filter to messungs query
Michael Stanko <mstanko@bfs.de>
parents:
1077
diff
changeset
|
313 forceSelection: false, |
ecce10cf32dc
add stus filter to messungs query
Michael Stanko <mstanko@bfs.de>
parents:
1077
diff
changeset
|
314 value: value, |
ecce10cf32dc
add stus filter to messungs query
Michael Stanko <mstanko@bfs.de>
parents:
1077
diff
changeset
|
315 filterId: filterId, |
ecce10cf32dc
add stus filter to messungs query
Michael Stanko <mstanko@bfs.de>
parents:
1077
diff
changeset
|
316 multiSelect: multi |
ecce10cf32dc
add stus filter to messungs query
Michael Stanko <mstanko@bfs.de>
parents:
1077
diff
changeset
|
317 }); |
ecce10cf32dc
add stus filter to messungs query
Michael Stanko <mstanko@bfs.de>
parents:
1077
diff
changeset
|
318 } |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
319 if (field) { |
1016
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
320 filterValues.add(field); |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
321 filters.show(); |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
322 hide = false; |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
323 } |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
324 } |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
325 if (hide) { |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
326 filters.hide(); |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
327 } |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
328 }, |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
329 |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
330 /** |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
331 * Function is called when the user clicks the search button. The function |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
332 * will perform a search to the server on refreshes the result list. |
975
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
908
diff
changeset
|
333 * To do so it replaces the store of the Resultgrids. |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
334 */ |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
335 search: function(element) { |
975
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
908
diff
changeset
|
336 var resultGrid = element.up('panel[name=main]').down('panel[name=contentpanel]').down('grid'); |
1016
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
337 var filters = element.up('panel[name=main]').down('panel[name=filtervalues]'); |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
338 var search = element.up('fieldset').down('combobox[name=filter]'); |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
339 |
1030
f4bd170f8ee6
Cancel search if no filter is selected.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1016
diff
changeset
|
340 if (!search.getValue()) { |
f4bd170f8ee6
Cancel search if no filter is selected.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1016
diff
changeset
|
341 return; |
f4bd170f8ee6
Cancel search if no filter is selected.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1016
diff
changeset
|
342 } |
975
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
908
diff
changeset
|
343 //Type of the search Proben/Messprogramme/Stammdaten |
1016
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
344 var type = search.store.getById(search.getValue()).get('type'); |
975
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
908
diff
changeset
|
345 |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
346 // Get search parameters: |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
347 var searchParams = {}; |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
348 searchParams['qid'] = search.getValue(); |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
349 for (var i = filters.items.length - 1; i >= 0; i--) { |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
350 var filter = filters.items.items[i]; |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
351 var value = filter.getValue(); |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
352 if (value instanceof Array) { |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
353 value = value.join(','); |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
354 } |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
355 searchParams[filter.getName()] = value; |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
356 } |
751
704bb359c0fe
dynamically exchange the store of the resultfiltergrid
Dustin Demuth <dustin@intevation.de>
parents:
742
diff
changeset
|
357 |
981
2c394e72ba41
Use the lada-server for stammdatenqueries.
Dustin Demuth <dustin@intevation.de>
parents:
979
diff
changeset
|
358 //Store depends of the Type... |
2c394e72ba41
Use the lada-server for stammdatenqueries.
Dustin Demuth <dustin@intevation.de>
parents:
979
diff
changeset
|
359 // TODO the switchcasese should be unified withj those in SelectSql |
2c394e72ba41
Use the lada-server for stammdatenqueries.
Dustin Demuth <dustin@intevation.de>
parents:
979
diff
changeset
|
360 switch (type) { |
983 | 361 case 'probe': |
981
2c394e72ba41
Use the lada-server for stammdatenqueries.
Dustin Demuth <dustin@intevation.de>
parents:
979
diff
changeset
|
362 sname = 'Lada.store.ProbenList'; |
2c394e72ba41
Use the lada-server for stammdatenqueries.
Dustin Demuth <dustin@intevation.de>
parents:
979
diff
changeset
|
363 break; |
1077
2a5d42045c63
Display Messungen query mode and use the new messung list grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1063
diff
changeset
|
364 case 'messung': |
2a5d42045c63
Display Messungen query mode and use the new messung list grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1063
diff
changeset
|
365 sname = 'Lada.store.MessungenList'; |
2a5d42045c63
Display Messungen query mode and use the new messung list grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1063
diff
changeset
|
366 break; |
981
2c394e72ba41
Use the lada-server for stammdatenqueries.
Dustin Demuth <dustin@intevation.de>
parents:
979
diff
changeset
|
367 case 'messprogramm': |
2c394e72ba41
Use the lada-server for stammdatenqueries.
Dustin Demuth <dustin@intevation.de>
parents:
979
diff
changeset
|
368 sname = 'Lada.store.MessprogrammeList'; |
2c394e72ba41
Use the lada-server for stammdatenqueries.
Dustin Demuth <dustin@intevation.de>
parents:
979
diff
changeset
|
369 break; |
2c394e72ba41
Use the lada-server for stammdatenqueries.
Dustin Demuth <dustin@intevation.de>
parents:
979
diff
changeset
|
370 case 'messprogrammkategorie': |
2c394e72ba41
Use the lada-server for stammdatenqueries.
Dustin Demuth <dustin@intevation.de>
parents:
979
diff
changeset
|
371 sname = 'Lada.store.MessprogrammKategorie'; |
2c394e72ba41
Use the lada-server for stammdatenqueries.
Dustin Demuth <dustin@intevation.de>
parents:
979
diff
changeset
|
372 break; |
2c394e72ba41
Use the lada-server for stammdatenqueries.
Dustin Demuth <dustin@intevation.de>
parents:
979
diff
changeset
|
373 case 'datensatzerzeuger': |
2c394e72ba41
Use the lada-server for stammdatenqueries.
Dustin Demuth <dustin@intevation.de>
parents:
979
diff
changeset
|
374 sname = 'Lada.store.DatensatzErzeuger'; |
2c394e72ba41
Use the lada-server for stammdatenqueries.
Dustin Demuth <dustin@intevation.de>
parents:
979
diff
changeset
|
375 break; |
2c394e72ba41
Use the lada-server for stammdatenqueries.
Dustin Demuth <dustin@intevation.de>
parents:
979
diff
changeset
|
376 case 'ort': |
1004
9ac03f461ab4
Introduced Orte into Stammdatengrids, Added Ortszuordnung. THIS COMMIT IS WORK IN PROGRESS, Proben will NOT work after this commit. Orte can not be edited.
Dustin Demuth <dustin@intevation.de>
parents:
983
diff
changeset
|
377 sname = 'Lada.store.Orte'; |
981
2c394e72ba41
Use the lada-server for stammdatenqueries.
Dustin Demuth <dustin@intevation.de>
parents:
979
diff
changeset
|
378 break; |
2c394e72ba41
Use the lada-server for stammdatenqueries.
Dustin Demuth <dustin@intevation.de>
parents:
979
diff
changeset
|
379 case 'probenehmer': |
2c394e72ba41
Use the lada-server for stammdatenqueries.
Dustin Demuth <dustin@intevation.de>
parents:
979
diff
changeset
|
380 sname = 'Lada.store.Probenehmer'; |
2c394e72ba41
Use the lada-server for stammdatenqueries.
Dustin Demuth <dustin@intevation.de>
parents:
979
diff
changeset
|
381 break; |
975
fb99332bb48e
Severe changes concerning the Resultgrids.
Dustin Demuth <dustin@intevation.de>
parents:
908
diff
changeset
|
382 } |
751
704bb359c0fe
dynamically exchange the store of the resultfiltergrid
Dustin Demuth <dustin@intevation.de>
parents:
742
diff
changeset
|
383 |
704bb359c0fe
dynamically exchange the store of the resultfiltergrid
Dustin Demuth <dustin@intevation.de>
parents:
742
diff
changeset
|
384 // Find the store or create a new one. |
704bb359c0fe
dynamically exchange the store of the resultfiltergrid
Dustin Demuth <dustin@intevation.de>
parents:
742
diff
changeset
|
385 var store = Ext.StoreManager.lookup(sname); |
704bb359c0fe
dynamically exchange the store of the resultfiltergrid
Dustin Demuth <dustin@intevation.de>
parents:
742
diff
changeset
|
386 if (!store) { |
704bb359c0fe
dynamically exchange the store of the resultfiltergrid
Dustin Demuth <dustin@intevation.de>
parents:
742
diff
changeset
|
387 store = Ext.create(sname); |
704bb359c0fe
dynamically exchange the store of the resultfiltergrid
Dustin Demuth <dustin@intevation.de>
parents:
742
diff
changeset
|
388 } |
704bb359c0fe
dynamically exchange the store of the resultfiltergrid
Dustin Demuth <dustin@intevation.de>
parents:
742
diff
changeset
|
389 if (store) { |
810
a5373ee662e2
Created a loading Animation for the Filterresultgrid
Dustin Demuth <dustin@intevation.de>
parents:
800
diff
changeset
|
390 store.addListener('beforeload', this.loadingAnimationOn, resultGrid); |
a5373ee662e2
Created a loading Animation for the Filterresultgrid
Dustin Demuth <dustin@intevation.de>
parents:
800
diff
changeset
|
391 store.addListener('load', this.loadingAnimationOff, resultGrid); |
1049
1bd4c0709bd6
Working version of selectable 'ort' in map and grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1021
diff
changeset
|
392 if (type === 'ort') { |
1bd4c0709bd6
Working version of selectable 'ort' in map and grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1021
diff
changeset
|
393 var panel = resultGrid.up('ortpanel'); |
1bd4c0709bd6
Working version of selectable 'ort' in map and grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1021
diff
changeset
|
394 store.addListener('load', panel.down('map').addLocations, panel.down('map')); |
1bd4c0709bd6
Working version of selectable 'ort' in map and grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1021
diff
changeset
|
395 panel.connectListeners(); |
1bd4c0709bd6
Working version of selectable 'ort' in map and grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1021
diff
changeset
|
396 } |
976
3c770fc7cf19
Added a variable which makes it possible to detect if a grid is dynamic
Dustin Demuth <dustin@intevation.de>
parents:
975
diff
changeset
|
397 |
751
704bb359c0fe
dynamically exchange the store of the resultfiltergrid
Dustin Demuth <dustin@intevation.de>
parents:
742
diff
changeset
|
398 resultGrid.setStore(store); |
976
3c770fc7cf19
Added a variable which makes it possible to detect if a grid is dynamic
Dustin Demuth <dustin@intevation.de>
parents:
975
diff
changeset
|
399 //TODO: Check if this is still necessary, as a Grid exists |
3c770fc7cf19
Added a variable which makes it possible to detect if a grid is dynamic
Dustin Demuth <dustin@intevation.de>
parents:
975
diff
changeset
|
400 // for each Type. |
3c770fc7cf19
Added a variable which makes it possible to detect if a grid is dynamic
Dustin Demuth <dustin@intevation.de>
parents:
975
diff
changeset
|
401 |
3c770fc7cf19
Added a variable which makes it possible to detect if a grid is dynamic
Dustin Demuth <dustin@intevation.de>
parents:
975
diff
changeset
|
402 if (resultGrid.isDynamic) { |
3c770fc7cf19
Added a variable which makes it possible to detect if a grid is dynamic
Dustin Demuth <dustin@intevation.de>
parents:
975
diff
changeset
|
403 //only the dynamic resultgrid can and needs to do the following: |
3c770fc7cf19
Added a variable which makes it possible to detect if a grid is dynamic
Dustin Demuth <dustin@intevation.de>
parents:
975
diff
changeset
|
404 resultGrid.setupColumns(this.displayFields); |
3c770fc7cf19
Added a variable which makes it possible to detect if a grid is dynamic
Dustin Demuth <dustin@intevation.de>
parents:
975
diff
changeset
|
405 } |
3c770fc7cf19
Added a variable which makes it possible to detect if a grid is dynamic
Dustin Demuth <dustin@intevation.de>
parents:
975
diff
changeset
|
406 |
751
704bb359c0fe
dynamically exchange the store of the resultfiltergrid
Dustin Demuth <dustin@intevation.de>
parents:
742
diff
changeset
|
407 resultGrid.getStore().proxy.extraParams = searchParams; |
704bb359c0fe
dynamically exchange the store of the resultfiltergrid
Dustin Demuth <dustin@intevation.de>
parents:
742
diff
changeset
|
408 resultGrid.getStore().load(); |
704bb359c0fe
dynamically exchange the store of the resultfiltergrid
Dustin Demuth <dustin@intevation.de>
parents:
742
diff
changeset
|
409 resultGrid.show(); |
704bb359c0fe
dynamically exchange the store of the resultfiltergrid
Dustin Demuth <dustin@intevation.de>
parents:
742
diff
changeset
|
410 } |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
411 }, |
810
a5373ee662e2
Created a loading Animation for the Filterresultgrid
Dustin Demuth <dustin@intevation.de>
parents:
800
diff
changeset
|
412 |
a5373ee662e2
Created a loading Animation for the Filterresultgrid
Dustin Demuth <dustin@intevation.de>
parents:
800
diff
changeset
|
413 /** |
a5373ee662e2
Created a loading Animation for the Filterresultgrid
Dustin Demuth <dustin@intevation.de>
parents:
800
diff
changeset
|
414 * Enable the Loading Animation of the Grid. |
a5373ee662e2
Created a loading Animation for the Filterresultgrid
Dustin Demuth <dustin@intevation.de>
parents:
800
diff
changeset
|
415 */ |
a5373ee662e2
Created a loading Animation for the Filterresultgrid
Dustin Demuth <dustin@intevation.de>
parents:
800
diff
changeset
|
416 loadingAnimationOn: function(store, operation) { |
a5373ee662e2
Created a loading Animation for the Filterresultgrid
Dustin Demuth <dustin@intevation.de>
parents:
800
diff
changeset
|
417 // this = resultgrid because of the scope which was set in addListener |
a5373ee662e2
Created a loading Animation for the Filterresultgrid
Dustin Demuth <dustin@intevation.de>
parents:
800
diff
changeset
|
418 this.setLoading(true); |
a5373ee662e2
Created a loading Animation for the Filterresultgrid
Dustin Demuth <dustin@intevation.de>
parents:
800
diff
changeset
|
419 }, |
a5373ee662e2
Created a loading Animation for the Filterresultgrid
Dustin Demuth <dustin@intevation.de>
parents:
800
diff
changeset
|
420 |
a5373ee662e2
Created a loading Animation for the Filterresultgrid
Dustin Demuth <dustin@intevation.de>
parents:
800
diff
changeset
|
421 /** |
a5373ee662e2
Created a loading Animation for the Filterresultgrid
Dustin Demuth <dustin@intevation.de>
parents:
800
diff
changeset
|
422 * Disable the Loading Animation of the Grid. |
a5373ee662e2
Created a loading Animation for the Filterresultgrid
Dustin Demuth <dustin@intevation.de>
parents:
800
diff
changeset
|
423 */ |
a5373ee662e2
Created a loading Animation for the Filterresultgrid
Dustin Demuth <dustin@intevation.de>
parents:
800
diff
changeset
|
424 loadingAnimationOff: function(store, operation) { |
a5373ee662e2
Created a loading Animation for the Filterresultgrid
Dustin Demuth <dustin@intevation.de>
parents:
800
diff
changeset
|
425 // this = resultgrid because of the scope which was set in addListener |
a5373ee662e2
Created a loading Animation for the Filterresultgrid
Dustin Demuth <dustin@intevation.de>
parents:
800
diff
changeset
|
426 this.setLoading(false); |
a5373ee662e2
Created a loading Animation for the Filterresultgrid
Dustin Demuth <dustin@intevation.de>
parents:
800
diff
changeset
|
427 }, |
a5373ee662e2
Created a loading Animation for the Filterresultgrid
Dustin Demuth <dustin@intevation.de>
parents:
800
diff
changeset
|
428 |
742
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
734
diff
changeset
|
429 /** |
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
734
diff
changeset
|
430 * This function resets the filters |
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
734
diff
changeset
|
431 */ |
734
2d482dfaa41a
Update list on search and reset filter values on reset button click.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
657
diff
changeset
|
432 reset: function(element) { |
1016
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
433 var filters = element.up('panel[name=main]').down('panel[name=filtervalues]'); |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
434 var search = element.up('fieldset').down('combobox[name=filter]'); |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
435 |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
436 //Type of the search Proben/Messprogramme/Stammdaten |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
437 var qId = search.getValue(); |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
438 var query = search.store.getById(qId); |
734
2d482dfaa41a
Update list on search and reset filter values on reset button click.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
657
diff
changeset
|
439 for (var i = filters.items.length - 1; i >= 0; i--) { |
2d482dfaa41a
Update list on search and reset filter values on reset button click.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
657
diff
changeset
|
440 var filter = filters.items.items[i]; |
1016
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
441 for (var j = 0; j < query.data.filters.length; j++) { |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
442 if (filter.filterId === query.data.filters[j].id) { |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
443 filter.setValue(query.data.filters[j].value); |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
444 } |
844
1449d58d6f58
Clear the text filter correctly.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
810
diff
changeset
|
445 } |
734
2d482dfaa41a
Update list on search and reset filter values on reset button click.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
657
diff
changeset
|
446 } |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
447 }, |
742
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
734
diff
changeset
|
448 /** |
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
734
diff
changeset
|
449 * This Function is supposed to handle the About action |
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
734
diff
changeset
|
450 * It has no function yet. |
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
734
diff
changeset
|
451 */ |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
452 about: function() { |
800
4b9b1d3ad9f1
Added about window, There are still some todos when retrieving the server version, the asynchronous request seems to fail and does not evaluate in time
Dustin Demuth <dustin@intevation.de>
parents:
794
diff
changeset
|
453 var win = Ext.create('Lada.view.window.About'); |
4b9b1d3ad9f1
Added about window, There are still some todos when retrieving the server version, the asynchronous request seems to fail and does not evaluate in time
Dustin Demuth <dustin@intevation.de>
parents:
794
diff
changeset
|
454 win.show(); |
1016
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
455 }, |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
456 |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
457 showDetails: function(element) { |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
458 var search = element.up('fieldset').down('combobox[name=filter]'); |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
459 var details = element.up('panel[name=main]').down('filterdetails'); |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
460 |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
461 //Type of the search Proben/Messprogramme/Stammdaten |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
462 var record = search.store.getById(search.getValue()); |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
463 details.setRecord(record); |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
464 if (element.pressed) { |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
465 details.show(); |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
466 } |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
467 else { |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
468 details.hide(); |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
469 } |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
470 }, |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
471 |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
472 showManagement: function() { |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
473 if (!this.managementWindow) { |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
474 this.managementWindow = Ext.create('Lada.view.window.FilterManagement'); |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
475 } |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
476 this.managementWindow.show(); |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
477 }, |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
478 |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
479 triggerFilterUpdate: function(checkbox) { |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
480 var cbox = checkbox.up('fieldset').down('combobox[name=filter]'); |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
481 this.updateFilter(cbox); |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
482 }, |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
483 |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
484 updateFilter: function(combobox) { |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
485 var store; |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
486 var entries; |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
487 var fav = combobox.up('fieldset').down('checkbox[name=favorites]'); |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
488 if (this.mode === 'proben') { |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
489 store = Ext.StoreManager.get('probequeries'); |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
490 } |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
491 else if (this.mode === 'messprogramme') { |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
492 store = Ext.StoreManager.get('messprogrammqueries'); |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
493 } |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
494 else if (this.mode === 'stammdaten') { |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
495 store = Ext.StoreManager.get('stammdatenqueries'); |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
496 } |
1077
2a5d42045c63
Display Messungen query mode and use the new messung list grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1063
diff
changeset
|
497 else if (this.mode === 'messungen') { |
2a5d42045c63
Display Messungen query mode and use the new messung list grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1063
diff
changeset
|
498 store = Ext.StoreManager.get('messungqueries'); |
2a5d42045c63
Display Messungen query mode and use the new messung list grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1063
diff
changeset
|
499 } |
1016
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
500 else { |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
501 return; |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
502 } |
1048
eacf25f071c0
Enable/Disable favorites checkbox whether user has query favorites or not.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1043
diff
changeset
|
503 var allEntries = store.queryBy(function() { |
eacf25f071c0
Enable/Disable favorites checkbox whether user has query favorites or not.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1043
diff
changeset
|
504 return true; |
eacf25f071c0
Enable/Disable favorites checkbox whether user has query favorites or not.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1043
diff
changeset
|
505 }); |
eacf25f071c0
Enable/Disable favorites checkbox whether user has query favorites or not.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1043
diff
changeset
|
506 var favorites = store.queryBy(function(record) { |
eacf25f071c0
Enable/Disable favorites checkbox whether user has query favorites or not.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1043
diff
changeset
|
507 if (record.get('favorite')) { |
eacf25f071c0
Enable/Disable favorites checkbox whether user has query favorites or not.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1043
diff
changeset
|
508 return true; |
eacf25f071c0
Enable/Disable favorites checkbox whether user has query favorites or not.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1043
diff
changeset
|
509 } |
eacf25f071c0
Enable/Disable favorites checkbox whether user has query favorites or not.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1043
diff
changeset
|
510 }); |
eacf25f071c0
Enable/Disable favorites checkbox whether user has query favorites or not.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1043
diff
changeset
|
511 combobox.store.removeAll(); |
eacf25f071c0
Enable/Disable favorites checkbox whether user has query favorites or not.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1043
diff
changeset
|
512 if (fav.checked && favorites.getCount() > 0) { |
eacf25f071c0
Enable/Disable favorites checkbox whether user has query favorites or not.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1043
diff
changeset
|
513 combobox.store.add(favorites.items); |
eacf25f071c0
Enable/Disable favorites checkbox whether user has query favorites or not.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1043
diff
changeset
|
514 } |
eacf25f071c0
Enable/Disable favorites checkbox whether user has query favorites or not.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1043
diff
changeset
|
515 else { |
eacf25f071c0
Enable/Disable favorites checkbox whether user has query favorites or not.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1043
diff
changeset
|
516 combobox.store.add(allEntries.items); |
eacf25f071c0
Enable/Disable favorites checkbox whether user has query favorites or not.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1043
diff
changeset
|
517 if (favorites.getCount() === 0) { |
1043
91f65b9cc2fb
Uncheck favorites if no favorite entries exist.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1042
diff
changeset
|
518 fav.setValue(false); |
1048
eacf25f071c0
Enable/Disable favorites checkbox whether user has query favorites or not.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1043
diff
changeset
|
519 fav.disable(); |
eacf25f071c0
Enable/Disable favorites checkbox whether user has query favorites or not.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1043
diff
changeset
|
520 } |
eacf25f071c0
Enable/Disable favorites checkbox whether user has query favorites or not.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1043
diff
changeset
|
521 else { |
eacf25f071c0
Enable/Disable favorites checkbox whether user has query favorites or not.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1043
diff
changeset
|
522 fav.enable(); |
1043
91f65b9cc2fb
Uncheck favorites if no favorite entries exist.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1042
diff
changeset
|
523 } |
1016
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
524 } |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
525 combobox.select(combobox.store.getAt(0)); |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
526 combobox.fireEvent('select', combobox, [combobox.store.getAt(0)]); |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
527 }, |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
528 |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
529 saveFilterDefaults: function(button) { |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
530 var filters = button.up('fieldset').down('panel[name=filtervalues]'); |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
531 |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
532 var search = button.up('fieldset').down('combobox[name=filter]'); |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
533 |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
534 //Type of the search Proben/Messprogramme/Stammdaten |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
535 var qId = search.getValue(); |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
536 var query = search.store.getById(qId); |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
537 var ndx = 0; |
1042
16c0c6946ae9
Fixed filter item check.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1030
diff
changeset
|
538 for (var i = filters.items.items.length - 1; i >= 0; i--) { |
1016
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
539 var filter = filters.items.items[i]; |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
540 var filterId = filter.filterId; |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
541 var value = filter.getValue(); |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
542 if (value instanceof Array) { |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
543 value = value.join(','); |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
544 } |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
545 Ext.Ajax.request({ |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
546 url: 'lada-server/rest/filter', |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
547 method: 'PUT', |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
548 jsonData: { |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
549 id: filterId, |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
550 value: value |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
551 }, |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
552 success: function() { |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
553 ndx++; |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
554 for (var j = 0; j < query.data.filters.length; i++) { |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
555 if (query.data.filters[j].id === filterId) { |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
556 query.data.filters[j].value = value; |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
557 break; |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
558 } |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
559 } |
1042
16c0c6946ae9
Fixed filter item check.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1030
diff
changeset
|
560 if (ndx < filters.items.items.length - 1) { |
1016
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
561 return; |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
562 } |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
563 if (query.get('type') === 'probe') { |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
564 Ext.StoreManager.get('probequeries').load(); |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
565 } |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
566 else if (query.get('type') === 'messprogramm') { |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
567 Ext.StoreManager.get('messprogrammqueries').load(); |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
568 } |
1077
2a5d42045c63
Display Messungen query mode and use the new messung list grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1063
diff
changeset
|
569 else if (query.get('type') === 'messung') { |
2a5d42045c63
Display Messungen query mode and use the new messung list grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1063
diff
changeset
|
570 Ext.StoreManager.get('messungqueries').load(); |
2a5d42045c63
Display Messungen query mode and use the new messung list grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1063
diff
changeset
|
571 } |
1016
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
572 else { |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
573 Ext.StoreManager.get('stammdatenqueries').load(); |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
574 } |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
575 } |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
576 }); |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
577 } |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
578 }, |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
579 |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
580 resetFilterDefaults: function(button) { |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
581 var filters = button.up('fieldset').down('panel[name=filtervalues]'); |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
582 |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
583 var search = button.up('fieldset').down('combobox[name=filter]'); |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
584 |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
585 var qId = search.getValue(); |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
586 var query = search.store.getById(qId); |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
587 for (var i = filters.items.length - 1; i >= 0; i--) { |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
588 var filter = filters.items.items[i]; |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
589 var filterId = filter.filterId; |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
590 var value = filter.getValue(); |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
591 if (value instanceof Array) { |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
592 value = value.join(','); |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
593 } |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
594 Ext.Ajax.request({ |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
595 url: 'lada-server/rest/filter/' + filterId, |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
596 method: 'DELETE', |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
597 success: function(response) { |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
598 var json = Ext.decode(response.responseText); |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
599 if (!json.success) { |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
600 return; |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
601 } |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
602 filter.setValue(json.data.value); |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
603 for (var j = 0; j < query.data.filters.length; j++) { |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
604 if (query.data.filters[j].id === json.data.id) { |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
605 query.data.filters[j].value = json.data.value; |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
606 break; |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
607 } |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
608 } |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
609 if (query.get('type') === 'probe') { |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
610 Ext.StoreManager.get('probequeries').reload(); |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
611 } |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
612 else if (query.get('type') === 'messprogramm') { |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
613 Ext.StoreManager.get('messprogrammqueries').reload(); |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
614 } |
1077
2a5d42045c63
Display Messungen query mode and use the new messung list grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1063
diff
changeset
|
615 else if (query.get('type') === 'messung') { |
2a5d42045c63
Display Messungen query mode and use the new messung list grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1063
diff
changeset
|
616 Ext.StoreManager.get('messungqueries').reload(); |
2a5d42045c63
Display Messungen query mode and use the new messung list grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1063
diff
changeset
|
617 } |
1016
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
618 else { |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
619 Ext.StoreManager.get('stammdatenqueries').reload(); |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
620 } |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
621 } |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
622 }); |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
623 } |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
624 } |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
625 }); |