annotate app/view/FilterPanel.js @ 1432:39bdb8eb26dd

Added tag 2.6.2 for changeset a1264beb05f9
author Marco Lechner, Bundesamt fuer Strahlenschutz, SW 2.1 <mlechner@bfs.de>
date Fri, 07 Apr 2017 11:30:02 +0200
parents 954c77216b2d
children
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 }, {
1104
414f7c9908d6 some reorg of filterpanal and messprogramm form
Michael Stanko <mstanko@bfs.de>
parents: 1064
diff changeset
47 layout: {
1280
3b4dcc83a21b fix sencha compile warnings
Michael Stanko <mstanko@bfs.de>
parents: 1104
diff changeset
48 type: 'hbox'
1104
414f7c9908d6 some reorg of filterpanal and messprogramm form
Michael Stanko <mstanko@bfs.de>
parents: 1064
diff changeset
49 },
414f7c9908d6 some reorg of filterpanal and messprogramm form
Michael Stanko <mstanko@bfs.de>
parents: 1064
diff changeset
50 border: false,
414f7c9908d6 some reorg of filterpanal and messprogramm form
Michael Stanko <mstanko@bfs.de>
parents: 1064
diff changeset
51 items: [{
414f7c9908d6 some reorg of filterpanal and messprogramm form
Michael Stanko <mstanko@bfs.de>
parents: 1064
diff changeset
52 xtype: 'checkbox',
414f7c9908d6 some reorg of filterpanal and messprogramm form
Michael Stanko <mstanko@bfs.de>
parents: 1064
diff changeset
53 name: 'favorites',
414f7c9908d6 some reorg of filterpanal and messprogramm form
Michael Stanko <mstanko@bfs.de>
parents: 1064
diff changeset
54 boxLabel: 'nur Favoriten',
414f7c9908d6 some reorg of filterpanal and messprogramm form
Michael Stanko <mstanko@bfs.de>
parents: 1064
diff changeset
55 checked: true
414f7c9908d6 some reorg of filterpanal and messprogramm form
Michael Stanko <mstanko@bfs.de>
parents: 1064
diff changeset
56 }, {
414f7c9908d6 some reorg of filterpanal and messprogramm form
Michael Stanko <mstanko@bfs.de>
parents: 1064
diff changeset
57 xtype: 'button',
414f7c9908d6 some reorg of filterpanal and messprogramm form
Michael Stanko <mstanko@bfs.de>
parents: 1064
diff changeset
58 action: 'manage',
414f7c9908d6 some reorg of filterpanal and messprogramm form
Michael Stanko <mstanko@bfs.de>
parents: 1064
diff changeset
59 text: 'Filterauswahl bearbeiten',
414f7c9908d6 some reorg of filterpanal and messprogramm form
Michael Stanko <mstanko@bfs.de>
parents: 1064
diff changeset
60 margin: '0 0 0 20'
414f7c9908d6 some reorg of filterpanal and messprogramm form
Michael Stanko <mstanko@bfs.de>
parents: 1064
diff changeset
61 }]
1015
af9879d72310 Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents: 870
diff changeset
62 }, {
af9879d72310 Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents: 870
diff changeset
63 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
64 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
65 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
66 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
67 value: '-/-'
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
68 }, {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
69 xtype: 'panel',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
70 border: false,
1104
414f7c9908d6 some reorg of filterpanal and messprogramm form
Michael Stanko <mstanko@bfs.de>
parents: 1064
diff changeset
71 margin: '10 0 10 0',
414f7c9908d6 some reorg of filterpanal and messprogramm form
Michael Stanko <mstanko@bfs.de>
parents: 1064
diff changeset
72 items: [{
414f7c9908d6 some reorg of filterpanal and messprogramm form
Michael Stanko <mstanko@bfs.de>
parents: 1064
diff changeset
73 xtype: 'button',
414f7c9908d6 some reorg of filterpanal and messprogramm form
Michael Stanko <mstanko@bfs.de>
parents: 1064
diff changeset
74 action: 'search',
1397
954c77216b2d Added search icon
Evi Huber <ehuber@bfs.de>
parents: 1280
diff changeset
75 icon: 'resources/img/Find.png',
1104
414f7c9908d6 some reorg of filterpanal and messprogramm form
Michael Stanko <mstanko@bfs.de>
parents: 1064
diff changeset
76 text: 'Suchen',
414f7c9908d6 some reorg of filterpanal and messprogramm form
Michael Stanko <mstanko@bfs.de>
parents: 1064
diff changeset
77 margin: '0 10 0 0'
414f7c9908d6 some reorg of filterpanal and messprogramm form
Michael Stanko <mstanko@bfs.de>
parents: 1064
diff changeset
78 }, {
414f7c9908d6 some reorg of filterpanal and messprogramm form
Michael Stanko <mstanko@bfs.de>
parents: 1064
diff changeset
79 xtype: 'button',
414f7c9908d6 some reorg of filterpanal and messprogramm form
Michael Stanko <mstanko@bfs.de>
parents: 1064
diff changeset
80 action: 'reset',
414f7c9908d6 some reorg of filterpanal and messprogramm form
Michael Stanko <mstanko@bfs.de>
parents: 1064
diff changeset
81 text: 'Zurücksetzen',
414f7c9908d6 some reorg of filterpanal and messprogramm form
Michael Stanko <mstanko@bfs.de>
parents: 1064
diff changeset
82 margin: '0 10 0 0'
414f7c9908d6 some reorg of filterpanal and messprogramm form
Michael Stanko <mstanko@bfs.de>
parents: 1064
diff changeset
83 }],
414f7c9908d6 some reorg of filterpanal and messprogramm form
Michael Stanko <mstanko@bfs.de>
parents: 1064
diff changeset
84 hidden: false
414f7c9908d6 some reorg of filterpanal and messprogramm form
Michael Stanko <mstanko@bfs.de>
parents: 1064
diff changeset
85 }, {
414f7c9908d6 some reorg of filterpanal and messprogramm form
Michael Stanko <mstanko@bfs.de>
parents: 1064
diff changeset
86 xtype: 'panel',
414f7c9908d6 some reorg of filterpanal and messprogramm form
Michael Stanko <mstanko@bfs.de>
parents: 1064
diff changeset
87 border: false,
1016
d6e259e76de6 Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1015
diff changeset
88 name: 'filtervariables',
d6e259e76de6 Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1015
diff changeset
89 hidden: true,
d6e259e76de6 Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1015
diff changeset
90 margin: '10, 0, 10, 0',
d6e259e76de6 Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1015
diff changeset
91 items: [{
d6e259e76de6 Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1015
diff changeset
92 xtype: 'panel',
d6e259e76de6 Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1015
diff changeset
93 border: false,
d6e259e76de6 Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1015
diff changeset
94 name: 'filtervalues',
d6e259e76de6 Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1015
diff changeset
95 items: []
d6e259e76de6 Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1015
diff changeset
96 }, {
d6e259e76de6 Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1015
diff changeset
97 layout: {
d6e259e76de6 Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1015
diff changeset
98 type: 'hbox',
d6e259e76de6 Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1015
diff changeset
99 pack: 'end'
d6e259e76de6 Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1015
diff changeset
100 },
d6e259e76de6 Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1015
diff changeset
101 border: false,
d6e259e76de6 Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1015
diff changeset
102 items: [{
d6e259e76de6 Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1015
diff changeset
103 xtype: 'button',
d6e259e76de6 Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1015
diff changeset
104 action: 'savedefault',
d6e259e76de6 Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1015
diff changeset
105 text: 'Vorbelegung speichern',
d6e259e76de6 Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1015
diff changeset
106 margin: '0, 10, 0, 0'
d6e259e76de6 Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1015
diff changeset
107 }, {
d6e259e76de6 Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1015
diff changeset
108 xtype: 'button',
d6e259e76de6 Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1015
diff changeset
109 action: 'resetdefault',
1064
cc17de34c689 Renamed button.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1029
diff changeset
110 text: 'Vorbelegung zurücksetzen'
1016
d6e259e76de6 Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1015
diff changeset
111 }]
d6e259e76de6 Updated filter value handling.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1015
diff changeset
112 }]
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
113 }];
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
114 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
115 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
116 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
117 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
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 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
120 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
121 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
122 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
123 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
124 }
af9879d72310 Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents: 870
diff changeset
125 });
1029
e3ca9f7d8a4f Avoid an empty filter combobox on startup.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1016
diff changeset
126 if (entries.getCount() === 0) {
e3ca9f7d8a4f Avoid an empty filter combobox on startup.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1016
diff changeset
127 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
128 cb.setValue(false);
e3ca9f7d8a4f Avoid an empty filter combobox on startup.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1016
diff changeset
129 }
1015
af9879d72310 Updated UI, added window for filter management and added fieldset for query
Raimund Renkert <raimund.renkert@intevation.de>
parents: 870
diff changeset
130 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
131 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
132 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
133 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
134 });
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
135 }
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
136 });

http://lada.wald.intevation.org