Mercurial > lada > lada-client
annotate app/view/FilterPanel.js @ 1045:d859fbfc8a53
Set date format for stammdaten grids.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Fri, 26 Feb 2016 09:40:53 +0100 |
parents | e3ca9f7d8a4f |
children | cc17de34c689 |
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 |
870
2e81d2ad6af7
added a * in coomments. jsduck can find this class now
Dustin Demuth <dustin@intevation.de>
parents:
795
diff
changeset
|
9 /** |
747
3ffecbce17d6
Radio-Buttons to switch between query-modes: Probenliste und Probenplanung. Filter-Combobox store wird automatisch gewechselt. ToDo: Query-Store für Probenplanung
Dustin Demuth <dustin@intevation.de>
parents:
609
diff
changeset
|
10 * Panel to show available search queries |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
11 */ |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
12 Ext.define('Lada.view.FilterPanel', { |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
13 extend: 'Ext.form.FieldSet', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
14 alias: 'widget.filterpanel', |
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 require: [ |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
17 'Ext.layout.container.Column' |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
18 ], |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
19 |
1015
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
870
diff
changeset
|
20 title: 'Filter', |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
21 initComponent: function() { |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
22 this.layout = { |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
23 type: 'vbox', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
24 align: 'stretch' |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
25 }; |
795
255568e97c96
Latest commit broke the search function
Dustin Demuth <dustin@intevation.de>
parents:
794
diff
changeset
|
26 var me = this; |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
27 this.items = [{ |
1015
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
870
diff
changeset
|
28 layout: 'hbox', |
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
870
diff
changeset
|
29 border: false, |
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
870
diff
changeset
|
30 items: [{ |
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
870
diff
changeset
|
31 xtype: 'combobox', |
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
870
diff
changeset
|
32 name: 'filter', |
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
870
diff
changeset
|
33 editable: false, |
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
870
diff
changeset
|
34 flex: 1, |
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
870
diff
changeset
|
35 displayField: 'name', |
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
870
diff
changeset
|
36 valueField: 'id', |
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
870
diff
changeset
|
37 queryMode: 'local', |
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
870
diff
changeset
|
38 emptyText: 'Wählen Sie eine Abfrage' |
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
870
diff
changeset
|
39 }, { |
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
870
diff
changeset
|
40 xtype: 'button', |
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
870
diff
changeset
|
41 action: 'details', |
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
870
diff
changeset
|
42 enableToggle: true, |
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
870
diff
changeset
|
43 text: 'Details', |
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
870
diff
changeset
|
44 margin: '0 0 0 10' |
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
870
diff
changeset
|
45 }] |
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
870
diff
changeset
|
46 }, { |
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
870
diff
changeset
|
47 xtype: 'checkbox', |
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
870
diff
changeset
|
48 name: 'favorites', |
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
870
diff
changeset
|
49 boxLabel: 'nur Favoriten', |
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
870
diff
changeset
|
50 margin: '0, 0, 0, 5', |
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
870
diff
changeset
|
51 checked: true |
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
870
diff
changeset
|
52 }, { |
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
870
diff
changeset
|
53 xtype: 'displayfield', |
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
870
diff
changeset
|
54 name: 'description', |
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
870
diff
changeset
|
55 shrinkWrap: 3, |
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
870
diff
changeset
|
56 margin: '0, 0, 0 ,5', |
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
870
diff
changeset
|
57 value: '-/-' |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
58 }, { |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
59 xtype: 'panel', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
60 border: false, |
1016
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
61 name: 'filtervariables', |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
62 hidden: true, |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
63 margin: '10, 0, 10, 0', |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
64 items: [{ |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
65 xtype: 'panel', |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
66 border: false, |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
67 name: 'filtervalues', |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
68 items: [] |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
69 }, { |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
70 |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
71 layout: { |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
72 type: 'hbox', |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
73 pack: 'end' |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
74 }, |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
75 border: false, |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
76 items: [{ |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
77 xtype: 'button', |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
78 action: 'savedefault', |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
79 text: 'Vorbelegung speichern', |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
80 margin: '0, 10, 0, 0' |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
81 }, { |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
82 xtype: 'button', |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
83 action: 'resetdefault', |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
84 text: 'Vorbelegung löschen' |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
85 }] |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
86 }] |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
87 }, { |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
88 xtype: 'panel', |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
89 border: false, |
d6e259e76de6
Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1015
diff
changeset
|
90 margin: '10 0 10 0', |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
91 items: [{ |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
92 xtype: 'button', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
93 action: 'search', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
94 text: 'Suchen', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
95 margin: '0 10 0 0' |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
96 }, { |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
97 xtype: 'button', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
98 action: 'reset', |
1015
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
870
diff
changeset
|
99 text: 'Zurücksetzen', |
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
870
diff
changeset
|
100 margin: '0 10 0 0' |
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
870
diff
changeset
|
101 }, { |
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
870
diff
changeset
|
102 xtype: 'button', |
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
870
diff
changeset
|
103 action: 'manage', |
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
870
diff
changeset
|
104 text: 'Filterauswahl bearbeiten' |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
105 }], |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
106 hidden: false |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
107 }]; |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
108 this.callParent(arguments); |
1015
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
870
diff
changeset
|
109 var combo = me.down('combobox[name=filter]'); |
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
870
diff
changeset
|
110 combo.store = Ext.create('Ext.data.Store', { |
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
870
diff
changeset
|
111 model: 'Lada.model.Query' |
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
870
diff
changeset
|
112 }); |
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
870
diff
changeset
|
113 var store = Ext.StoreManager.get('probequeries'); |
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
870
diff
changeset
|
114 store.on('load', function storeLoad () { |
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
870
diff
changeset
|
115 var entries = store.queryBy(function(record) { |
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
870
diff
changeset
|
116 if (record.get('favorite')) { |
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
870
diff
changeset
|
117 return true; |
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
870
diff
changeset
|
118 } |
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
870
diff
changeset
|
119 }); |
1029
e3ca9f7d8a4f
Avoid an empty filter combobox on startup.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1016
diff
changeset
|
120 if (entries.getCount() === 0) { |
e3ca9f7d8a4f
Avoid an empty filter combobox on startup.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1016
diff
changeset
|
121 var cb = me.down('checkbox[name=favorites]'); |
e3ca9f7d8a4f
Avoid an empty filter combobox on startup.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1016
diff
changeset
|
122 cb.setValue(false); |
e3ca9f7d8a4f
Avoid an empty filter combobox on startup.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1016
diff
changeset
|
123 } |
1015
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
870
diff
changeset
|
124 combo.store.add(entries.items); |
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
870
diff
changeset
|
125 combo.select(combo.store.getAt(0)); |
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
870
diff
changeset
|
126 combo.fireEvent('select', combo, [combo.store.getAt(0)]); |
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
870
diff
changeset
|
127 store.un('load', storeLoad); |
af9879d72310
Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents:
870
diff
changeset
|
128 }); |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
129 } |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
130 }); |