Mercurial > lada > lada-client
annotate app/view/window/Ortszuordnung.js @ 1328:cf73b7d7cf99
reinserted discard button and functionality
author | Maximilian Krambach <mkrambach@intevation.de> |
---|---|
date | Fri, 03 Feb 2017 15:31:18 +0100 |
parents | f1e348109ebb |
children | 2c5d89886885 |
rev | line source |
---|---|
1013
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
2 * Software engineering by Intevation GmbH |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
3 * |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
4 * This file is Free Software under the GNU GPL (v>=3) |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
6 * the documentation coming with IMIS-Labordaten-Application for details. |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
7 */ |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
8 |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
9 /** |
1289
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
10 * Window to create/edit the Ort/Probe or Ort/Messprogramm Relation |
1013
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
11 */ |
1289
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
12 |
1013
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
13 Ext.define('Lada.view.window.Ortszuordnung', { |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
14 extend: 'Ext.window.Window', |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
15 alias: 'widget.ortszuordnungwindow', |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
16 |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
17 requires: [ |
1289
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
18 'Lada.model.Ortszuordnung', |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
19 'Lada.model.OrtszuordnungMp', |
1021
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
20 'Lada.view.form.Ortszuordnung', |
1279
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1274
diff
changeset
|
21 'Lada.view.form.Ortserstellung', |
1288
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1287
diff
changeset
|
22 'Lada.view.panel.Map', |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1287
diff
changeset
|
23 'Lada.view.grid.Orte' |
1013
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
24 ], |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
25 |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
26 collapsible: true, |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
27 maximizable: true, |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
28 autoshow: true, |
1274
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
29 layout: 'fit', |
1013
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
30 constrain: true, |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
31 |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
32 probe: null, |
1289
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
33 messprogramm: null, |
1288
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1287
diff
changeset
|
34 |
1013
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
35 parentWindow: null, |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
36 record: null, |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
37 grid: null, |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
38 |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
39 /** |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
40 * This function initialises the Window |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
41 */ |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
42 initComponent: function() { |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
43 var i18n = Lada.getApplication().bundle; |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
44 this.title = i18n.getMsg('ortszuordnung.window.title'); |
1289
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
45 var recordtype; |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
46 if (this.probe) { |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
47 if (this.record) { |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
48 // A probe record will be edited |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
49 this.title = i18n.getMsg('ortszuordnung.window.title') |
1013
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
50 + ' ' |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
51 + i18n.getMsg('ortszuordnung.window.title2') |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
52 + ' ' |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
53 + i18n.getMsg('probe') |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
54 + ' ' |
1138
a3a715417540
Fixed typo in datafield getter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1134
diff
changeset
|
55 + this.probe.get('hauptprobenNr') |
1013
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
56 + ' ' |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
57 + i18n.getMsg('edit'); |
1289
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
58 } else { |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
59 // A new probe record will be created |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
60 this.title = i18n.getMsg('ortszuordnung.window.title') |
1013
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
61 + ' ' |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
62 + i18n.getMsg('ortszuordnung.window.title2') |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
63 + ' ' |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
64 + i18n.getMsg('probe') |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
65 + ' ' |
1138
a3a715417540
Fixed typo in datafield getter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1134
diff
changeset
|
66 + this.probe.get('hauptprobenNr') |
1013
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
67 + ' ' |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
68 + i18n.getMsg('create'); |
1289
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
69 } |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
70 } else if (this.messprogramm) { |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
71 if (this.record) { |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
72 // A messprogramm record will be edited |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
73 this.title = i18n.getMsg('ortszuordnung.window.title') |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
74 + ' ' |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
75 + i18n.getMsg('ortszuordnung.window.title2') |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
76 + ' ' |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
77 + i18n.getMsg('messprogramm') |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
78 + ' ' |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
79 + i18n.getMsg('edit'); |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
80 } else { |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
81 // A new messprogramm record will be created |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
82 this.title = i18n.getMsg('ortszuordnung.window.title') |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
83 + ' ' |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
84 + i18n.getMsg('ortszuordnung.window.title2') |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
85 + ' ' |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
86 + i18n.getMsg('messprogramm') |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
87 + ' ' |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
88 + i18n.getMsg('create'); |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
89 } |
1013
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
90 } |
1289
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
91 |
1013
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
92 this.buttons = [{ |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
93 text: i18n.getMsg('close'), |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
94 scope: this, |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
95 handler: this.close |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
96 }]; |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
97 this.width = 900; |
1274
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
98 this.height = 465; |
1013
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
99 this.bodyStyle = {background: '#fff'}; |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
100 |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
101 // add listeners to change the window appearence when it becomes inactive |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
102 this.on({ |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
103 activate: function(){ |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
104 this.getEl().removeCls('window-inactive'); |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
105 }, |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
106 deactivate: function(){ |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
107 this.getEl().addCls('window-inactive'); |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
108 } |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
109 }); |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
110 |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
111 this.items = [{ |
1274
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
112 layout: 'border', |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
113 bodyStyle: {background: '#fff'}, |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
114 border: 0, |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
115 items: [{ |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
116 xtype: 'map', |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
117 region: 'center', |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
118 layout: 'border', |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
119 margin: '13, 5, 10, 5', |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
120 minHeight: 380, |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
121 externalOrteStore: true |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
122 }, { |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
123 xtype: 'ortszuordnungform', |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
124 region: 'east', |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
125 minHeight: 380, |
1289
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
126 type: this.probe? 'probe': 'mpr' |
1274
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
127 }, { |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
128 region: 'south', |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
129 border: 0, |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
130 layout: 'fit', |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
131 name: 'ortgrid', |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
132 hidden: true, |
1308
6075731bc4f1
Added column filter to orte grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1307
diff
changeset
|
133 height: 240, |
1274
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
134 items: [{ |
1279
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1274
diff
changeset
|
135 xtype: 'ortstammdatengrid' |
1274
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
136 }], |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
137 dockedItems: [{ |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
138 xtype: 'toolbar', |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
139 dock: 'bottom', |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
140 items: [{ |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
141 xtype: 'textfield', |
1287
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
142 name: 'search', |
1274
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
143 labelWidth: 50, |
1287
e317ba349204
Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1284
diff
changeset
|
144 enableKeyEvents: true, |
1274
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
145 fieldLabel: i18n.getMsg('ortszuordnung.ortsuche'), |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
146 }, '->', { |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
147 text: i18n.getMsg('orte.new'), |
1279
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1274
diff
changeset
|
148 action: 'createort' |
1274
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
149 }, { |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
150 text: i18n.getMsg('orte.frommap'), |
1279
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1274
diff
changeset
|
151 action: 'frommap' |
1274
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
152 }, { |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
153 text: i18n.getMsg('orte.clone'), |
1292
317ae6bfd647
Clone button only activated if an ort has been selected in the grid
Maximilian Krambach <mkrambach@intevation.de>
parents:
1289
diff
changeset
|
154 action: 'clone', |
317ae6bfd647
Clone button only activated if an ort has been selected in the grid
Maximilian Krambach <mkrambach@intevation.de>
parents:
1289
diff
changeset
|
155 disabled : true |
1274
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
156 }] |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
157 }] |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
158 }] |
1013
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
159 }]; |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
160 this.callParent(arguments); |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
161 }, |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
162 |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
163 /** |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
164 * Initialise the Data of this Window |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
165 */ |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
166 initData: function() { |
1274
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
167 var me = this; |
1134
f1d21e6a7449
Fixed adding new ortszuortnung for probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1133
diff
changeset
|
168 if (!this.record) { |
1289
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
169 if (this.probe) { |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
170 this.record = Ext.create('Lada.model.Ortszuordnung'); |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
171 this.record.set('probeId', this.probe.get('id')); |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
172 } else { |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
173 this.record = Ext.create('Lada.model.OrtszuordnungMp'); |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
174 this.record.set('messprogrammId', this.messprogramm.get('id')); |
bfdc00c24baf
Ortszuordnung for messprogramm and probe using same form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1288
diff
changeset
|
175 } |
1134
f1d21e6a7449
Fixed adding new ortszuortnung for probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1133
diff
changeset
|
176 if (!this.record.get('letzteAenderung')) { |
f1d21e6a7449
Fixed adding new ortszuortnung for probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1133
diff
changeset
|
177 this.record.data.letzteAenderung = new Date(); |
f1d21e6a7449
Fixed adding new ortszuortnung for probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1133
diff
changeset
|
178 } |
f1d21e6a7449
Fixed adding new ortszuortnung for probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1133
diff
changeset
|
179 } |
1013
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
180 this.down('ortszuordnungform').setRecord(this.record); |
1274
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
181 var osg = this.down('ortstammdatengrid'); |
1302
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
182 var map = this.down('map'); |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
183 osg.setLoading(true); |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
184 map.setLoading(true); |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
185 this.ortstore = Ext.data.StoreManager.get('orte'); |
1318
cc90b8050887
code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1308
diff
changeset
|
186 this.ortstore.load(); |
1302
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
187 var ortId; |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
188 if (this.messprogramm) { |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
189 ortId = this.record.get('ort'); |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
190 } else { |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
191 ortId = this.record.get('ortId'); |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
192 } |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
193 if (ortId !== undefined && !this.ortstore.findRecord('id', ortId)) { |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
194 var record = Ext.create('Lada.model.Ort'); |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
195 record.set('id', ortId); |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
196 this.ortstore.add(record); |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
197 Lada.model.Ort.load(ortId, { |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
198 success: function(rec) { |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
199 record.beginEdit(); |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
200 for (key in rec.getData()) { |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
201 record.set(key, rec.getData()[key]); |
1274
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
202 } |
1302
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
203 record.endEdit(); |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
204 me.onStoreLoaded(); |
1274
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
205 } |
1302
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
206 }); |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
207 } else { |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
208 me.onStoreLoaded(); |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
209 } |
1279
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1274
diff
changeset
|
210 map.addListener('featureselected', osg.selectOrt, osg); |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1274
diff
changeset
|
211 osg.addListener('select', map.selectFeature, map); |
1292
317ae6bfd647
Clone button only activated if an ort has been selected in the grid
Maximilian Krambach <mkrambach@intevation.de>
parents:
1289
diff
changeset
|
212 osg.addListener('select', me.activateCloneButton, me); |
1021
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
213 }, |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
214 |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
215 /** |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
216 * @private |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
217 * Override to display and update the map view in the panel. |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
218 */ |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
219 afterRender: function(){ |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
220 this.superclass.afterRender.apply(this, arguments); |
1274
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
221 var map = this.down('map'); |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
222 map.map.addControl(new OpenLayers.Control.LayerSwitcher()); |
1013
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
223 }, |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
224 |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
225 /** |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
226 * Instructs the fields / forms listed in this method to set a message. |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
227 * @param errors These Errors shall be shown |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
228 * @param warnings These Warning shall be shown |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
229 */ |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
230 setMessages: function(errors, warnings) { |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
231 //todo this is a stub |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
232 }, |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
233 |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
234 /** |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
235 * Instructs the fields / forms listed in this method to clear their messages. |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
236 */ |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
237 clearMessages: function() { |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
238 //todo this is a stub |
1292
317ae6bfd647
Clone button only activated if an ort has been selected in the grid
Maximilian Krambach <mkrambach@intevation.de>
parents:
1289
diff
changeset
|
239 }, |
317ae6bfd647
Clone button only activated if an ort has been selected in the grid
Maximilian Krambach <mkrambach@intevation.de>
parents:
1289
diff
changeset
|
240 |
317ae6bfd647
Clone button only activated if an ort has been selected in the grid
Maximilian Krambach <mkrambach@intevation.de>
parents:
1289
diff
changeset
|
241 activateCloneButton: function() { |
317ae6bfd647
Clone button only activated if an ort has been selected in the grid
Maximilian Krambach <mkrambach@intevation.de>
parents:
1289
diff
changeset
|
242 var toolbar = this.down('panel[name=ortgrid]').getDockedItems()[0]; |
317ae6bfd647
Clone button only activated if an ort has been selected in the grid
Maximilian Krambach <mkrambach@intevation.de>
parents:
1289
diff
changeset
|
243 toolbar.down('button[action=clone]').enable(); |
1302
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
244 }, |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
245 |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
246 /** |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
247 * childs will be populated with store entries after all entries are loaded |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
248 * from all sources |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
249 */ |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
250 onStoreLoaded: function() { |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
251 var map = this.down('map'); |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
252 var osg = this.down('ortstammdatengrid'); |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
253 osg.setStore(this.ortstore); |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
254 map.addLocations(this.ortstore); |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
255 map.featureLayer.setVisibility(false); |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
256 map.selectedFeatureLayer = new OpenLayers.Layer.Vector( |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
257 'gewählter Messpunkt', { |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
258 styleMap: new OpenLayers.StyleMap({ |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
259 externalGraphic: 'resources/lib/OpenLayers/img/marker-blue.png', |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
260 pointRadius: 12, |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
261 label: '${bez}', |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
262 labelAlign: 'rt', |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
263 fontColor: 'blue', |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
264 fontWeight: 'bold', |
1307
152fca74a839
Fixed Map layer display of selected Ort
Maximilian Krambach <mkrambach@intevation.de>
parents:
1304
diff
changeset
|
265 labelOutlineColor: 'white', |
152fca74a839
Fixed Map layer display of selected Ort
Maximilian Krambach <mkrambach@intevation.de>
parents:
1304
diff
changeset
|
266 labelOutlineWidth: 3 |
1302
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
267 }), |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
268 displayInLayerSwitcher: false, |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
269 projection: new OpenLayers.Projection('EPSG:3857') |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
270 }); |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
271 map.map.addLayer(map.selectedFeatureLayer); |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
272 var ortId; |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
273 if (this.messprogramm) { |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
274 ortId = this.record.get('ort'); |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
275 } else { |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
276 ortId = this.record.get('ortId'); |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
277 } |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
278 if (ortId){ |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
279 var feat = map.featureLayer.getFeaturesByAttribute('id', ortId); |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
280 var ortrecord = this.ortstore.findRecord('id', ortId); |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
281 osg.selectOrt(map, feat); |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
282 map.selectFeature(this.model, ortrecord); |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
283 this.down('ortszuordnungform').setOrt(null,ortrecord); |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
284 } |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
285 osg.setLoading(false); |
322da3ad0c0b
Load current Ort into ortszuordnungswindow even if netzbetreiber doesn't match
Maximilian Krambach <mkrambach@intevation.de>
parents:
1294
diff
changeset
|
286 map.setLoading(false); |
1304
9f15a932a525
Fixed ort filter close actions.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1303
diff
changeset
|
287 }, |
9f15a932a525
Fixed ort filter close actions.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1303
diff
changeset
|
288 |
9f15a932a525
Fixed ort filter close actions.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1303
diff
changeset
|
289 onEsc: function() { |
9f15a932a525
Fixed ort filter close actions.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1303
diff
changeset
|
290 var me = this; |
9f15a932a525
Fixed ort filter close actions.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1303
diff
changeset
|
291 var search = me.down('textfield[name=search]'); |
9f15a932a525
Fixed ort filter close actions.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1303
diff
changeset
|
292 if (search.hasFocus) { |
9f15a932a525
Fixed ort filter close actions.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1303
diff
changeset
|
293 return; |
9f15a932a525
Fixed ort filter close actions.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1303
diff
changeset
|
294 } |
9f15a932a525
Fixed ort filter close actions.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1303
diff
changeset
|
295 me.callParent(arguments); |
9f15a932a525
Fixed ort filter close actions.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1303
diff
changeset
|
296 } |
1013
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
297 }); |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
298 |