Mercurial > lada > lada-client
annotate app/view/window/Ortszuordnung.js @ 1279:291df0037835
Ortszuordnung window: create, change and display (wip)
author | Maximilian Krambach <mkrambach@intevation.de> |
---|---|
date | Wed, 18 Jan 2017 11:41:50 +0100 |
parents | a792eecf1614 |
children | faecbb446a04 |
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 /** |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
10 * Window to create/edit the Ort / Probe Relation |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
11 */ |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
12 Ext.define('Lada.view.window.Ortszuordnung', { |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
13 extend: 'Ext.window.Window', |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
14 alias: 'widget.ortszuordnungwindow', |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
15 |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
16 requires: [ |
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
|
17 'Lada.view.form.Ortszuordnung', |
1279
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1274
diff
changeset
|
18 'Lada.view.form.Ortserstellung', |
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
|
19 'Lada.view.panel.Ort' |
1013
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
20 ], |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
21 |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
22 collapsible: true, |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
23 maximizable: true, |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
24 autoshow: true, |
1274
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
25 layout: 'fit', |
1013
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
26 constrain: true, |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
27 |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
28 probe: null, |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
29 parentWindow: null, |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
30 record: null, |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
31 grid: null, |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
32 |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
33 /** |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
34 * This function initialises the Window |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
35 */ |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
36 initComponent: function() { |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
37 var i18n = Lada.getApplication().bundle; |
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 this.title = i18n.getMsg('ortszuordnung.window.title'); |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
40 |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
41 if (this.record && this.probe) { |
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
|
42 // A record be edited |
1013
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
43 this.title = i18n.getMsg('ortszuordnung.window.title') |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
44 + ' ' |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
45 + i18n.getMsg('ortszuordnung.window.title2') |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
46 + ' ' |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
47 + i18n.getMsg('probe') |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
48 + ' ' |
1138
a3a715417540
Fixed typo in datafield getter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1134
diff
changeset
|
49 + this.probe.get('hauptprobenNr') |
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('edit'); |
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 else if (this.probe) { |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
54 // A new record will be created |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
55 this.title = i18n.getMsg('ortszuordnung.window.title') |
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('ortszuordnung.window.title2') |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
58 + ' ' |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
59 + i18n.getMsg('probe') |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
60 + ' ' |
1138
a3a715417540
Fixed typo in datafield getter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1134
diff
changeset
|
61 + this.probe.get('hauptprobenNr') |
1013
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
62 + ' ' |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
63 + i18n.getMsg('create'); |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
64 } |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
65 |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
66 this.buttons = [{ |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
67 text: i18n.getMsg('close'), |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
68 scope: this, |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
69 handler: this.close |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
70 }]; |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
71 this.width = 900; |
1274
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
72 this.height = 465; |
1013
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
73 this.bodyStyle = {background: '#fff'}; |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
74 |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
75 // 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
|
76 this.on({ |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
77 activate: function(){ |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
78 this.getEl().removeCls('window-inactive'); |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
79 }, |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
80 deactivate: function(){ |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
81 this.getEl().addCls('window-inactive'); |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
82 } |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
83 }); |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
84 |
1274
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
85 |
1013
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
86 this.items = [{ |
1274
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
87 layout: 'border', |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
88 bodyStyle: {background: '#fff'}, |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
89 border: 0, |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
90 items: [{ |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
91 xtype: 'map', |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
92 region: 'center', |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
93 layout: 'border', |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
94 margin: '13, 5, 10, 5', |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
95 minHeight: 380, |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
96 externalOrteStore: true |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
97 }, { |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
98 xtype: 'ortszuordnungform', |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
99 region: 'east', |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
100 minHeight: 380, |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
101 }, { |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
102 region: 'south', |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
103 border: 0, |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
104 layout: 'fit', |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
105 name: 'ortgrid', |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
106 hidden: true, |
1279
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1274
diff
changeset
|
107 maxHeight: 240, |
1274
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
108 items: [{ |
1279
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1274
diff
changeset
|
109 xtype: 'ortstammdatengrid' |
1274
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
110 }], |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
111 dockedItems: [{ |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
112 xtype: 'toolbar', |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
113 dock: 'bottom', |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
114 border: '0, 1, 1, 1', |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
115 style: { |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
116 borderBottom: '1px solid #b5b8c8 !important', |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
117 borderLeft: '1px solid #b5b8c8 !important', |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
118 borderRight: '1px solid #b5b8c8 !important' |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
119 }, |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
120 items: [{ |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
121 xtype: 'textfield', |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
122 labelWidth: 50, |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
123 fieldLabel: i18n.getMsg('ortszuordnung.ortsuche'), |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
124 }, '->', { |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
125 text: i18n.getMsg('orte.new'), |
1279
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1274
diff
changeset
|
126 action: 'createort' |
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 text: i18n.getMsg('orte.frommap'), |
1279
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1274
diff
changeset
|
129 action: 'frommap' |
1274
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
130 }, { |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
131 text: i18n.getMsg('orte.clone'), |
1279
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1274
diff
changeset
|
132 action: 'clone' |
1274
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
133 }] |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
134 }] |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
135 }] |
1013
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
136 }]; |
1279
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1274
diff
changeset
|
137 |
1013
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
138 this.callParent(arguments); |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
139 }, |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
140 |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
141 /** |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
142 * Initialise the Data of this Window |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
143 */ |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
144 initData: function() { |
1274
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
145 var me = this; |
1134
f1d21e6a7449
Fixed adding new ortszuortnung for probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1133
diff
changeset
|
146 if (!this.record) { |
f1d21e6a7449
Fixed adding new ortszuortnung for probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1133
diff
changeset
|
147 this.record = Ext.create('Lada.model.Ortszuordnung'); |
f1d21e6a7449
Fixed adding new ortszuortnung for probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1133
diff
changeset
|
148 if (!this.record.get('letzteAenderung')) { |
f1d21e6a7449
Fixed adding new ortszuortnung for probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1133
diff
changeset
|
149 this.record.data.letzteAenderung = new Date(); |
f1d21e6a7449
Fixed adding new ortszuortnung for probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1133
diff
changeset
|
150 } |
f1d21e6a7449
Fixed adding new ortszuortnung for probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1133
diff
changeset
|
151 this.record.set('probeId', this.probe.get('id')); |
f1d21e6a7449
Fixed adding new ortszuortnung for probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1133
diff
changeset
|
152 } |
1013
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
153 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
|
154 var map = this.down('map'); |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
155 var osg = this.down('ortstammdatengrid'); |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
156 var ortstore = Ext.create('Lada.store.Orte', { |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
157 defaultPageSize: 0, |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
158 autoLoad: false, |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
159 listeners: { |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
160 beforeload: { |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
161 fn: function() { |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
162 osg.setLoading(true); |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
163 map.setLoading(true); |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
164 } |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
165 }, |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
166 load: { |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
167 fn: function() { |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
168 osg.setLoading(false); |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
169 map.setLoading(false); |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
170 osg.setStore(ortstore); |
1279
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1274
diff
changeset
|
171 map.addLocations(ortstore); |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1274
diff
changeset
|
172 map.featureLayer.setVisibility(false); |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1274
diff
changeset
|
173 map.selectedFeatureLayer = new OpenLayers.Layer.Vector( |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1274
diff
changeset
|
174 'gewählter Messpunkt', { |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1274
diff
changeset
|
175 styleMap: new OpenLayers.StyleMap({ |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1274
diff
changeset
|
176 externalGraphic: 'resources/lib/OpenLayers/img/marker-blue.png', |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1274
diff
changeset
|
177 pointRadius: 10, |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1274
diff
changeset
|
178 label: '${bez}', |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1274
diff
changeset
|
179 labelAlign: 'rt', |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1274
diff
changeset
|
180 fontColor: 'blue', |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1274
diff
changeset
|
181 fontWeight: 'bold', |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1274
diff
changeset
|
182 }), |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1274
diff
changeset
|
183 displayInLayerSwitcher: false, |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1274
diff
changeset
|
184 projection: new OpenLayers.Projection('EPSG:3857') |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1274
diff
changeset
|
185 }); |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1274
diff
changeset
|
186 map.map.addLayer(map.selectedFeatureLayer); |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1274
diff
changeset
|
187 map.selectedFeatureLayer.setZIndex(499); |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1274
diff
changeset
|
188 var ortId = me.record.get('ortId'); |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1274
diff
changeset
|
189 if (ortId){ |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1274
diff
changeset
|
190 var feat = map.featureLayer.getFeaturesByAttribute('id', ortId)[0]; |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1274
diff
changeset
|
191 map.selectControl.select(feat); |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1274
diff
changeset
|
192 } |
1274
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
193 } |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
194 } |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
195 } |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
196 }); |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
197 ortstore.load(); |
1279
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1274
diff
changeset
|
198 map.addListener('featureselected', osg.selectOrt, osg); |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
1274
diff
changeset
|
199 osg.addListener('select', map.selectFeature, map); |
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
|
200 }, |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
201 |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
202 /** |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
203 * @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
|
204 * 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
|
205 */ |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
206 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
|
207 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
|
208 var map = this.down('map'); |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
209 map.map.addControl(new OpenLayers.Control.LayerSwitcher()); |
1013
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
210 }, |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
211 |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
212 /** |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
213 * 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
|
214 * @param errors These Errors shall be shown |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
215 * @param warnings These Warning shall be shown |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
216 */ |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
217 setMessages: function(errors, warnings) { |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
218 //todo this is a stub |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
219 }, |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
220 |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
221 /** |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
222 * 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
|
223 */ |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
224 clearMessages: function() { |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
225 //todo this is a stub |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
226 } |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
227 }); |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
228 |