Mercurial > lada > lada-client
comparison app/view/window/OrtFilter.js @ 1287:e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Thu, 26 Jan 2017 17:33:56 +0100 |
parents | |
children | 049038c4a9c1 |
comparison
equal
deleted
inserted
replaced
1286:8b21a3fa6e1f | 1287:e317ba349204 |
---|---|
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz | |
2 * Software engineering by Intevation GmbH | |
3 * | |
4 * This file is Free Software under the GNU GPL (v>=3) | |
5 * and comes with ABSOLUTELY NO WARRANTY! Check out | |
6 * the documentation coming with IMIS-Labordaten-Application for details. | |
7 */ | |
8 | |
9 /** | |
10 * Panel for universal orte search resultset. | |
11 * | |
12 */ | |
13 Ext.define('Lada.view.window.OrtFilter', { | |
14 extend: 'Ext.window.Window', | |
15 alias: 'widget.ortfilterwindow', | |
16 | |
17 // layout: 'vbox', | |
18 layout: { | |
19 type: 'vbox', | |
20 align: 'left' | |
21 }, | |
22 width: 400, | |
23 resizable: false, | |
24 shadow: false, | |
25 alwaysOnTop: true, | |
26 | |
27 initComponent: function() { | |
28 var me = this; | |
29 var i18n = Lada.getApplication().bundle; | |
30 | |
31 me.items = [{ | |
32 name: 'nohits', | |
33 html: 'keine Treffer', | |
34 hidden: true, | |
35 width: '100%', | |
36 minHeight: 30 | |
37 }, { | |
38 xtype: 'grid', | |
39 name: 'messpunkte', | |
40 hideHeaders: true, | |
41 title: i18n.getMsg('orte'), | |
42 minHeight: 30, | |
43 maxHeight: 100, | |
44 width: '100%', | |
45 columns: [{ | |
46 dataIndex: 'ortId' | |
47 }, { | |
48 dataIndex: 'kurztext', | |
49 flex: 1 | |
50 }, { | |
51 dataIndex: 'gemId' | |
52 }] | |
53 }, { | |
54 xtype: 'grid', | |
55 name: 'verwaltungseinheiten', | |
56 hideHeaders: true, | |
57 title: i18n.getMsg('verwaltungseinheit'), | |
58 minHeight: 30, | |
59 maxHeight: 100, | |
60 width: '100%', | |
61 columns: [{ | |
62 dataIndex: 'id', | |
63 flex: 1, | |
64 renderer: function(value, meta, record) { | |
65 return value + ' - ' + record.get('bezeichnung'); | |
66 } | |
67 }] | |
68 }, { | |
69 xtype: 'grid', | |
70 name: 'staaten', | |
71 hideHeaders: true, | |
72 title: i18n.getMsg('staaten'), | |
73 minHeight: 30, | |
74 maxHeight: 100, | |
75 width: '100%', | |
76 columns: [{ | |
77 dataIndex: 'id', | |
78 flex: 1, | |
79 renderer: function(value, meta, record) { | |
80 return record.get('staatIso') + ' - ' + record.get('staat'); | |
81 } | |
82 }] | |
83 }]; | |
84 | |
85 me.callParent(arguments); | |
86 }, | |
87 | |
88 updateGrids: function(orte, verwaltungseinheiten, staaten) { | |
89 var mp = this.down('grid[name=messpunkte]') | |
90 var ve = this.down('grid[name=verwaltungseinheiten]'); | |
91 var st = this.down('grid[name=staaten]'); | |
92 var nohits = this.down('panel[name=nohits]'); | |
93 if (orte.count() > 0) { | |
94 mp.reconfigure(orte); | |
95 mp.show(); | |
96 nohits.hide(); | |
97 } | |
98 else { | |
99 mp.hide(); | |
100 } | |
101 if(verwaltungseinheiten.count() > 0) { | |
102 ve.reconfigure(verwaltungseinheiten) | |
103 ve.show(); | |
104 nohits.hide(); | |
105 } | |
106 else { | |
107 ve.hide(); | |
108 } | |
109 if (staaten.count() > 0) { | |
110 st.reconfigure(staaten) | |
111 st.show(); | |
112 nohits.hide(); | |
113 } | |
114 else { | |
115 st.hide(); | |
116 } | |
117 if (orte.count() === 0 && | |
118 verwaltungseinheiten.count() === 0 && | |
119 staaten.count() === 0 | |
120 ) { | |
121 nohits.show(); | |
122 } | |
123 }, | |
124 | |
125 reposition: function(x, y) { | |
126 var height = this.getHeight(); | |
127 this.setX(x); | |
128 this.setY(y - height); | |
129 } | |
130 }); |