Mercurial > lada > lada-client
annotate app/controller/grid/Ortszuordnung.js @ 1288:08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
author | Maximilian Krambach <mkrambach@intevation.de> |
---|---|
date | Fri, 27 Jan 2017 13:25:14 +0100 |
parents | e317ba349204 |
children | bfdc00c24baf |
rev | line source |
---|---|
587
cf328526b5bb
Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz |
cf328526b5bb
Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
2 * Software engineering by Intevation GmbH |
cf328526b5bb
Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
3 * |
cf328526b5bb
Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
4 * This file is Free Software under the GNU GPL (v>=3) |
cf328526b5bb
Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out |
cf328526b5bb
Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
6 * the documentation coming with IMIS-Labordaten-Application for details. |
cf328526b5bb
Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
7 */ |
cf328526b5bb
Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
8 |
742
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
701
diff
changeset
|
9 /** |
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
701
diff
changeset
|
10 * This is a controller for a grid of Orte |
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
701
diff
changeset
|
11 */ |
1012
2adc329d90fe
Replaced Locations with Ortszuordnung
Dustin Demuth <dustin@intevation.de>
parents:
826
diff
changeset
|
12 Ext.define('Lada.controller.grid.Ortszuordnung', { |
587
cf328526b5bb
Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
13 extend: 'Ext.app.Controller', |
cf328526b5bb
Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
14 |
602
e1ab24758392
Updated the ort grid controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
587
diff
changeset
|
15 requires: [ |
1279
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1051
diff
changeset
|
16 'Lada.view.window.Ortszuordnung', |
1288
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1287
diff
changeset
|
17 'Lada.view.window.Ortserstellung', |
1287
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
18 'Lada.view.window.OrtFilter' |
602
e1ab24758392
Updated the ort grid controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
587
diff
changeset
|
19 ], |
e1ab24758392
Updated the ort grid controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
587
diff
changeset
|
20 |
1287
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
21 resultPanel: null, |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
22 searchField: null, |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
23 |
742
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
701
diff
changeset
|
24 /** |
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
701
diff
changeset
|
25 * Inhitialize the controller |
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
701
diff
changeset
|
26 * It has 3 listeners |
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
701
diff
changeset
|
27 */ |
587
cf328526b5bb
Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
28 init: function() { |
cf328526b5bb
Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
29 this.control({ |
1012
2adc329d90fe
Replaced Locations with Ortszuordnung
Dustin Demuth <dustin@intevation.de>
parents:
826
diff
changeset
|
30 'ortszuordnunggrid': { |
602
e1ab24758392
Updated the ort grid controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
587
diff
changeset
|
31 itemdblclick: this.open |
587
cf328526b5bb
Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
32 }, |
1012
2adc329d90fe
Replaced Locations with Ortszuordnung
Dustin Demuth <dustin@intevation.de>
parents:
826
diff
changeset
|
33 'ortszuordnunggrid button[action=add]': { |
587
cf328526b5bb
Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
34 click: this.add |
cf328526b5bb
Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
35 }, |
1012
2adc329d90fe
Replaced Locations with Ortszuordnung
Dustin Demuth <dustin@intevation.de>
parents:
826
diff
changeset
|
36 'ortszuordnunggrid button[action=delete]': { |
587
cf328526b5bb
Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
37 click: this.remove |
1279
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1051
diff
changeset
|
38 }, |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1051
diff
changeset
|
39 'ortszuordnungwindow toolbar button[action=createort]':{ |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1051
diff
changeset
|
40 click: this.createort |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1051
diff
changeset
|
41 }, |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1051
diff
changeset
|
42 'ortszuordnungwindow toolbar button[action=frommap]':{ |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1051
diff
changeset
|
43 click: this.frommap |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1051
diff
changeset
|
44 }, |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1051
diff
changeset
|
45 'ortszuordnungwindow toolbar button[action=clone]':{ |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1051
diff
changeset
|
46 click: this.cloneort |
1287
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
47 }, |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
48 'ortszuordnungwindow toolbar textfield[name=search]': { |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
49 keyup: this.search |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
50 }, |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
51 'ortfilterwindow grid[name=messpunkte]': { |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
52 itemdblclick: this.selectedMesspunkt |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
53 }, |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
54 'ortfilterwindow grid[name=verwaltungseinheiten]': { |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
55 itemdblclick: this.selectedVerwaltungseinheit |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
56 }, |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
57 'ortfilterwindow grid[name=staaten]': { |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
58 itemdblclick: this.selectedStaat |
587
cf328526b5bb
Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
59 } |
cf328526b5bb
Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
60 }); |
cf328526b5bb
Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
61 }, |
cf328526b5bb
Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
62 |
742
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
701
diff
changeset
|
63 /** |
1013
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
1012
diff
changeset
|
64 * When open is called, a {@link Lada.view.window.Ortszuordnung} |
742
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
701
diff
changeset
|
65 * is created which allows to edit the Orte |
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
701
diff
changeset
|
66 */ |
602
e1ab24758392
Updated the ort grid controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
587
diff
changeset
|
67 open: function(grid, record) { |
690
e88381fb3bdb
Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
644
diff
changeset
|
68 var probe = grid.up('window').record; |
1013
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
1012
diff
changeset
|
69 var win = Ext.create('Lada.view.window.Ortszuordnung', { |
690
e88381fb3bdb
Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
644
diff
changeset
|
70 parentWindow: grid.up('window'), |
1279
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1051
diff
changeset
|
71 probe: probe, |
1028
2e7adc19b4fe
Do not copy the Record to the Ortszuordnungwin
Dustin Demuth <dustin@intevation.de>
parents:
1022
diff
changeset
|
72 record: record, |
644
71e8b84d7829
Reload grids on messung or ort changed/added.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
643
diff
changeset
|
73 grid: grid |
587
cf328526b5bb
Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
74 }); |
602
e1ab24758392
Updated the ort grid controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
587
diff
changeset
|
75 win.show(); |
e1ab24758392
Updated the ort grid controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
587
diff
changeset
|
76 win.initData(); |
587
cf328526b5bb
Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
77 }, |
cf328526b5bb
Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
78 |
742
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
701
diff
changeset
|
79 /** |
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
701
diff
changeset
|
80 * This function adds a new row to add an Ort |
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
701
diff
changeset
|
81 */ |
643
477379250512
Open the ort create window on button click.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
602
diff
changeset
|
82 add: function(button) { |
477379250512
Open the ort create window on button click.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
602
diff
changeset
|
83 var probe = button.up('window').record; |
1013
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
1012
diff
changeset
|
84 var win = Ext.create('Lada.view.window.Ortszuordnung', { |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
1012
diff
changeset
|
85 parentWindow: button.up('window'), |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
1012
diff
changeset
|
86 probe: probe, |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
1012
diff
changeset
|
87 record: null, |
1012
2adc329d90fe
Replaced Locations with Ortszuordnung
Dustin Demuth <dustin@intevation.de>
parents:
826
diff
changeset
|
88 grid: button.up('ortszuordnung') |
643
477379250512
Open the ort create window on button click.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
602
diff
changeset
|
89 }); |
477379250512
Open the ort create window on button click.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
602
diff
changeset
|
90 win.show(); |
477379250512
Open the ort create window on button click.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
602
diff
changeset
|
91 win.initData(); |
587
cf328526b5bb
Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
92 }, |
cf328526b5bb
Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
93 |
742
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
701
diff
changeset
|
94 /** |
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
701
diff
changeset
|
95 * A Ort-row can be removed from the grid with the remove |
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
701
diff
changeset
|
96 * function. It asks the user for confirmation |
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
701
diff
changeset
|
97 * If the removal was confirmed, it reloads the parent window on success, |
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
701
diff
changeset
|
98 * on failure, an error message is shown. |
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
701
diff
changeset
|
99 */ |
587
cf328526b5bb
Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
100 remove: function(button) { |
cf328526b5bb
Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
101 var grid = button.up('grid'); |
cf328526b5bb
Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
102 var selection = grid.getView().getSelectionModel().getSelection()[0]; |
1012
2adc329d90fe
Replaced Locations with Ortszuordnung
Dustin Demuth <dustin@intevation.de>
parents:
826
diff
changeset
|
103 var i18n = Lada.getApplication().bundle; |
2adc329d90fe
Replaced Locations with Ortszuordnung
Dustin Demuth <dustin@intevation.de>
parents:
826
diff
changeset
|
104 Ext.MessageBox.confirm(i18n.getMsg('delete'), i18n.getMsg('confirmation.question'), |
2adc329d90fe
Replaced Locations with Ortszuordnung
Dustin Demuth <dustin@intevation.de>
parents:
826
diff
changeset
|
105 function(btn) { |
2adc329d90fe
Replaced Locations with Ortszuordnung
Dustin Demuth <dustin@intevation.de>
parents:
826
diff
changeset
|
106 if (btn === 'yes') { |
587
cf328526b5bb
Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
107 selection.destroy({ |
cf328526b5bb
Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
108 success: function() { |
cf328526b5bb
Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
109 button.up('window').initData(); |
cf328526b5bb
Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
110 }, |
701
f0bc5387abcc
Added failure - Messages
Dustin Demuth <dustin@intevation.de>
parents:
690
diff
changeset
|
111 failure: function(request, response) { |
1012
2adc329d90fe
Replaced Locations with Ortszuordnung
Dustin Demuth <dustin@intevation.de>
parents:
826
diff
changeset
|
112 var i18n = Lada.getApplication().bundle; |
701
f0bc5387abcc
Added failure - Messages
Dustin Demuth <dustin@intevation.de>
parents:
690
diff
changeset
|
113 var json = response.request.scope.reader.jsonData; |
f0bc5387abcc
Added failure - Messages
Dustin Demuth <dustin@intevation.de>
parents:
690
diff
changeset
|
114 if (json) { |
f0bc5387abcc
Added failure - Messages
Dustin Demuth <dustin@intevation.de>
parents:
690
diff
changeset
|
115 if (json.message){ |
1012
2adc329d90fe
Replaced Locations with Ortszuordnung
Dustin Demuth <dustin@intevation.de>
parents:
826
diff
changeset
|
116 Ext.Msg.alert(i18n.getMsg('err.msg.delete.title') |
701
f0bc5387abcc
Added failure - Messages
Dustin Demuth <dustin@intevation.de>
parents:
690
diff
changeset
|
117 +' #'+json.message, |
1012
2adc329d90fe
Replaced Locations with Ortszuordnung
Dustin Demuth <dustin@intevation.de>
parents:
826
diff
changeset
|
118 i18n.getMsg(json.message)); |
701
f0bc5387abcc
Added failure - Messages
Dustin Demuth <dustin@intevation.de>
parents:
690
diff
changeset
|
119 } else { |
1012
2adc329d90fe
Replaced Locations with Ortszuordnung
Dustin Demuth <dustin@intevation.de>
parents:
826
diff
changeset
|
120 Ext.Msg.alert(i18n.getMsg('err.msg.delete.title'), |
2adc329d90fe
Replaced Locations with Ortszuordnung
Dustin Demuth <dustin@intevation.de>
parents:
826
diff
changeset
|
121 i18n.getMsg('err.msg.generic.body')); |
701
f0bc5387abcc
Added failure - Messages
Dustin Demuth <dustin@intevation.de>
parents:
690
diff
changeset
|
122 } |
f0bc5387abcc
Added failure - Messages
Dustin Demuth <dustin@intevation.de>
parents:
690
diff
changeset
|
123 } else { |
1012
2adc329d90fe
Replaced Locations with Ortszuordnung
Dustin Demuth <dustin@intevation.de>
parents:
826
diff
changeset
|
124 Ext.Msg.alert(i18n.getMsg('err.msg.delete.title'), |
2adc329d90fe
Replaced Locations with Ortszuordnung
Dustin Demuth <dustin@intevation.de>
parents:
826
diff
changeset
|
125 i18n.getMsg('err.msg.response.body')); |
701
f0bc5387abcc
Added failure - Messages
Dustin Demuth <dustin@intevation.de>
parents:
690
diff
changeset
|
126 } |
587
cf328526b5bb
Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
127 } |
cf328526b5bb
Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
128 }); |
cf328526b5bb
Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
129 } |
cf328526b5bb
Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
130 }); |
826
2362f8ab1e9f
disable remove button after a item is deleted from grid
Dustin Demuth <dustin@intevation.de>
parents:
742
diff
changeset
|
131 grid.down('button[action=delete]').disable(); |
1279
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1051
diff
changeset
|
132 }, |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1051
diff
changeset
|
133 |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1051
diff
changeset
|
134 /** |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1051
diff
changeset
|
135 * Opens the form for a new Messpunkt |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1051
diff
changeset
|
136 */ |
1288
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1287
diff
changeset
|
137 createort: function(button) { |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1287
diff
changeset
|
138 Ext.create('Lada.view.window.Ortserstellung',{ |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1287
diff
changeset
|
139 parentWindow: button.up('ortszuordnungwindow') |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1287
diff
changeset
|
140 }).show(); |
1279
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1051
diff
changeset
|
141 }, |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1051
diff
changeset
|
142 |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1051
diff
changeset
|
143 /** |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1051
diff
changeset
|
144 * |
1288
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1287
diff
changeset
|
145 * Creates an event listener for a map click |
1279
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1051
diff
changeset
|
146 */ |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1051
diff
changeset
|
147 frommap: function(button) { |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1051
diff
changeset
|
148 var map = button.up('ortszuordnungwindow').down('map'); |
1288
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1287
diff
changeset
|
149 var me = this; |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1287
diff
changeset
|
150 map.map.events.register('click', button, me.newOrtfromMapClick); |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1287
diff
changeset
|
151 // TODO visual feedback that map click is active. |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1287
diff
changeset
|
152 // TODO Deactivate event listener if button is destroyed |
1279
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1051
diff
changeset
|
153 }, |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1051
diff
changeset
|
154 |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1051
diff
changeset
|
155 /** |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1051
diff
changeset
|
156 * Opens the form for a new Messpunkt, with all values prefilled from the currently |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1051
diff
changeset
|
157 * selected item |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1051
diff
changeset
|
158 */ |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1051
diff
changeset
|
159 cloneort: function(button) { |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1051
diff
changeset
|
160 var grid = button.up('ortszuordnungwindow').down('ortstammdatengrid').getView(); |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1051
diff
changeset
|
161 var selected = grid.getSelectionModel().getSelection()[0]; |
1288
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1287
diff
changeset
|
162 Ext.create('Lada.view.window.Ortserstellung', { |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1287
diff
changeset
|
163 record: Ext.create('Lada.model.Ort', selected.data), |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1287
diff
changeset
|
164 parentWindow: button.up('ortszuordnungwindow') |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1287
diff
changeset
|
165 }).show(); |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1287
diff
changeset
|
166 }, |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1287
diff
changeset
|
167 |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1287
diff
changeset
|
168 /** |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1287
diff
changeset
|
169 * Gets the clicked map's coordinates and opens a new Messpunkt window with coordinates prefilled |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1287
diff
changeset
|
170 */ |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1287
diff
changeset
|
171 newOrtfromMapClick: function(evt) { |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1287
diff
changeset
|
172 var me = this; //this = button(action:frommap) |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1287
diff
changeset
|
173 var map = this.up('ortszuordnungwindow').down('map').map; |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1287
diff
changeset
|
174 var lonlat = map.getLonLatFromViewPortPx(evt.xy).transform(new OpenLayers.Projection('EPSG:3857'), |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1287
diff
changeset
|
175 new OpenLayers.Projection('EPSG:4326')); |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1287
diff
changeset
|
176 var controller = Lada.app.getController('Lada.controller.grid.Ortszuordnung'); |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1287
diff
changeset
|
177 map.events.unregister('click', this, controller.newOrtfromMapClick); |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1287
diff
changeset
|
178 Ext.create('Lada.view.window.Ortserstellung', { |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1287
diff
changeset
|
179 record: Ext.create('Lada.model.Ort',{ |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1287
diff
changeset
|
180 koordXExtern: lonlat.lon, |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1287
diff
changeset
|
181 koordYExtern: lonlat.lat, |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1287
diff
changeset
|
182 kdaId : 4 |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1287
diff
changeset
|
183 }), |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1287
diff
changeset
|
184 parentWindow: this.up('ortszuordnungwindow') |
1284
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
185 }).show(); |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
186 }, |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
187 |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
188 /** |
1287
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
189 * Search triggered by textfield key event. |
1284
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
190 */ |
1287
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
191 search: function(field, evt, opts) { |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
192 this.searchField = field; |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
193 if ((evt.getKey() == 13 || evt.getKey() == 8) && field.getValue() && field.getValue().length > 0) { |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
194 this.execSearch(field, field.getValue()); |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
195 } |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
196 if (field.getValue().length === 0) { |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
197 this.resultPanel.hide(); |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
198 return; |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
199 } |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
200 if (field.getValue().length < 3) { |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
201 return; |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
202 } |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
203 this.execSearch(field, field.getValue()); |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
204 }, |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
205 |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
206 /* |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
207 * Execute search in stores (ort, verwaltungseinheit and staat) and |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
208 * display the resultset. |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
209 */ |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
210 execSearch: function(field, filter) { |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
211 // Filter stores |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
212 var messpunkte = Ext.data.StoreManager.get('orte'); |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
213 var verwaltungseinheiten = Ext.data.StoreManager.get('verwaltungseinheiten'); |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
214 var staaten = Ext.data.StoreManager.get('staaten'); |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
215 messpunkte.clearFilter(true); |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
216 verwaltungseinheiten.clearFilter(true); |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
217 staaten.clearFilter(true); |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
218 messpunkte.filter({filterFn: function(item) { |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
219 if (item.get('ortId').indexOf(filter) > -1) { |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
220 return true; |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
221 } |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
222 if (item.get('kurztext').indexOf(filter) > -1) { |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
223 return true; |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
224 } |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
225 if (item.get('langtext').indexOf(filter) > -1) { |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
226 return true; |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
227 } |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
228 if (item.get('berichtstext') && |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
229 item.get('berichtstext').indexOf(filter) > -1) { |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
230 return true; |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
231 } |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
232 if (item.get('gemId').indexOf(filter) > -1) { |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
233 return true; |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
234 } |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
235 }}); |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
236 verwaltungseinheiten.filter('bezeichnung', filter); |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
237 staaten.filter('staat', filter); |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
238 |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
239 if (!this.resultPanel) { |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
240 this.resultPanel = Ext.create('Lada.view.window.OrtFilter', { |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
241 x: 500, |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
242 y: 500, |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
243 alwaysOnTop: true |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
244 }); |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
245 } |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
246 this.resultPanel.show(); |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
247 this.resultPanel.updateGrids(messpunkte, verwaltungseinheiten, staaten); |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
248 this.resultPanel.reposition(field.getX() + field.getLabelWidth(), field.getY()); |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
249 field.focus(); |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
250 }, |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
251 |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
252 selectedMesspunkt: function(grid, record) { |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
253 var win = grid.up('window'); |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
254 win.hide(); |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
255 this.searchField.reset(); |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
256 var grid = this.searchField.up('panel').down('ortstammdatengrid'); |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
257 grid.getSelectionModel().select(record); |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
258 grid.getView().focusRow(record); |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
259 }, |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
260 |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
261 selectedVerwaltungseinheit: function(grid, record) { |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
262 var win = grid.up('window'); |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
263 win.hide(); |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
264 this.searchField.reset(); |
1288
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1287
diff
changeset
|
265 Ext.create('Lada.view.window.Ortserstellung', { |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1287
diff
changeset
|
266 record: Ext.create('Lada.model.Ort', record.data), |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1287
diff
changeset
|
267 parentWindow: grid.up('ortszuordnungwindow') |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1287
diff
changeset
|
268 }).show(); |
1287
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
269 }, |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
270 |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
271 selectedStaat: function(grid, record) { |
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
272 var win = grid.up('window'); |
1288
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1287
diff
changeset
|
273 console.log(grid.up('ortszuordnungwindow')); |
1287
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
274 win.hide(); |
1288
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1287
diff
changeset
|
275 Ext.create('Lada.view.window.Ortserstellung', { |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1287
diff
changeset
|
276 record: Ext.create('Lada.model.Ort', record.data), |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1287
diff
changeset
|
277 parentWindow: grid.up('ortszuordnungwindow') |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1287
diff
changeset
|
278 }).show(); |
1287
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
279 this.searchField.reset(); |
587
cf328526b5bb
Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
280 } |
cf328526b5bb
Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
281 }); |