annotate app/view/window/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
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',
1288
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1287
diff changeset
19 'Lada.view.panel.Map',
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1287
diff changeset
20 'Lada.view.grid.Orte'
1013
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
75ce503ab296 Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
23 collapsible: true,
75ce503ab296 Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
24 maximizable: true,
75ce503ab296 Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
25 autoshow: true,
1274
a792eecf1614 Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1138
diff changeset
26 layout: 'fit',
1013
75ce503ab296 Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
27 constrain: true,
75ce503ab296 Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
28
75ce503ab296 Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
29 probe: null,
1288
08085b7d1d0b Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents: 1287
diff changeset
30
1013
75ce503ab296 Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
31 parentWindow: null,
75ce503ab296 Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
32 record: null,
75ce503ab296 Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
33 grid: null,
75ce503ab296 Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
34
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 * This function initialises the Window
75ce503ab296 Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
37 */
75ce503ab296 Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
38 initComponent: function() {
75ce503ab296 Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
39 var i18n = Lada.getApplication().bundle;
75ce503ab296 Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
40 this.title = i18n.getMsg('ortszuordnung.window.title');
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 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
43 // A record be edited
1013
75ce503ab296 Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
44 this.title = i18n.getMsg('ortszuordnung.window.title')
75ce503ab296 Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
45 + ' '
75ce503ab296 Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
46 + i18n.getMsg('ortszuordnung.window.title2')
75ce503ab296 Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
47 + ' '
75ce503ab296 Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
48 + i18n.getMsg('probe')
75ce503ab296 Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
49 + ' '
1138
a3a715417540 Fixed typo in datafield getter.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1134
diff changeset
50 + this.probe.get('hauptprobenNr')
1013
75ce503ab296 Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
51 + ' '
75ce503ab296 Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
52 + i18n.getMsg('edit');
75ce503ab296 Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
53 }
75ce503ab296 Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
54 else if (this.probe) {
75ce503ab296 Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
55 // A new record will be created
75ce503ab296 Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
56 this.title = i18n.getMsg('ortszuordnung.window.title')
75ce503ab296 Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
57 + ' '
75ce503ab296 Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
58 + i18n.getMsg('ortszuordnung.window.title2')
75ce503ab296 Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
59 + ' '
75ce503ab296 Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
60 + i18n.getMsg('probe')
75ce503ab296 Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
61 + ' '
1138
a3a715417540 Fixed typo in datafield getter.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1134
diff changeset
62 + this.probe.get('hauptprobenNr')
1013
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('create');
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
75ce503ab296 Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
85 this.items = [{
1274
a792eecf1614 Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1138
diff changeset
86 layout: 'border',
a792eecf1614 Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1138
diff changeset
87 bodyStyle: {background: '#fff'},
a792eecf1614 Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1138
diff changeset
88 border: 0,
a792eecf1614 Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1138
diff changeset
89 items: [{
a792eecf1614 Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1138
diff changeset
90 xtype: 'map',
a792eecf1614 Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1138
diff changeset
91 region: 'center',
a792eecf1614 Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1138
diff changeset
92 layout: 'border',
a792eecf1614 Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1138
diff changeset
93 margin: '13, 5, 10, 5',
a792eecf1614 Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1138
diff changeset
94 minHeight: 380,
a792eecf1614 Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1138
diff changeset
95 externalOrteStore: true
a792eecf1614 Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1138
diff changeset
96 }, {
a792eecf1614 Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1138
diff changeset
97 xtype: 'ortszuordnungform',
a792eecf1614 Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1138
diff changeset
98 region: 'east',
a792eecf1614 Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1138
diff changeset
99 minHeight: 380,
a792eecf1614 Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1138
diff changeset
100 }, {
a792eecf1614 Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1138
diff changeset
101 region: 'south',
a792eecf1614 Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1138
diff changeset
102 border: 0,
a792eecf1614 Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1138
diff changeset
103 layout: 'fit',
a792eecf1614 Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1138
diff changeset
104 name: 'ortgrid',
a792eecf1614 Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1138
diff changeset
105 hidden: true,
1279
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1274
diff changeset
106 maxHeight: 240,
1274
a792eecf1614 Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1138
diff changeset
107 items: [{
1279
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1274
diff changeset
108 xtype: 'ortstammdatengrid'
1274
a792eecf1614 Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1138
diff changeset
109 }],
a792eecf1614 Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1138
diff changeset
110 dockedItems: [{
a792eecf1614 Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1138
diff changeset
111 xtype: 'toolbar',
a792eecf1614 Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1138
diff changeset
112 dock: 'bottom',
a792eecf1614 Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1138
diff changeset
113 border: '0, 1, 1, 1',
a792eecf1614 Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1138
diff changeset
114 style: {
a792eecf1614 Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1138
diff changeset
115 borderBottom: '1px solid #b5b8c8 !important',
a792eecf1614 Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1138
diff changeset
116 borderLeft: '1px solid #b5b8c8 !important',
a792eecf1614 Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1138
diff changeset
117 borderRight: '1px solid #b5b8c8 !important'
a792eecf1614 Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1138
diff changeset
118 },
a792eecf1614 Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1138
diff changeset
119 items: [{
a792eecf1614 Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1138
diff changeset
120 xtype: 'textfield',
1287
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
121 name: 'search',
1274
a792eecf1614 Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1138
diff changeset
122 labelWidth: 50,
1287
e317ba349204 Added search for orte, verwaltungseinheiten and staaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1284
diff changeset
123 enableKeyEvents: true,
1274
a792eecf1614 Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1138
diff changeset
124 fieldLabel: i18n.getMsg('ortszuordnung.ortsuche'),
a792eecf1614 Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1138
diff changeset
125 }, '->', {
a792eecf1614 Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1138
diff changeset
126 text: i18n.getMsg('orte.new'),
1279
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1274
diff changeset
127 action: 'createort'
1274
a792eecf1614 Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1138
diff changeset
128 }, {
a792eecf1614 Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1138
diff changeset
129 text: i18n.getMsg('orte.frommap'),
1279
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1274
diff changeset
130 action: 'frommap'
1274
a792eecf1614 Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1138
diff changeset
131 }, {
a792eecf1614 Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1138
diff changeset
132 text: i18n.getMsg('orte.clone'),
1279
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1274
diff changeset
133 action: 'clone'
1274
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 }]
a792eecf1614 Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1138
diff changeset
136 }]
1013
75ce503ab296 Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
137 }];
1279
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1274
diff changeset
138
1013
75ce503ab296 Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
139 this.callParent(arguments);
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 /**
75ce503ab296 Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
143 * Initialise the Data of this Window
75ce503ab296 Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
144 */
75ce503ab296 Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
145 initData: function() {
1274
a792eecf1614 Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1138
diff changeset
146 var me = this;
1134
f1d21e6a7449 Fixed adding new ortszuortnung for probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1133
diff changeset
147 if (!this.record) {
f1d21e6a7449 Fixed adding new ortszuortnung for probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1133
diff changeset
148 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
149 if (!this.record.get('letzteAenderung')) {
f1d21e6a7449 Fixed adding new ortszuortnung for probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1133
diff changeset
150 this.record.data.letzteAenderung = new Date();
f1d21e6a7449 Fixed adding new ortszuortnung for probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1133
diff changeset
151 }
f1d21e6a7449 Fixed adding new ortszuortnung for probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1133
diff changeset
152 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
153 }
1013
75ce503ab296 Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
154 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
155 var map = this.down('map');
a792eecf1614 Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1138
diff changeset
156 var osg = this.down('ortstammdatengrid');
1284
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
157 this.ortstore = Ext.create('Lada.store.Orte', {
1274
a792eecf1614 Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1138
diff changeset
158 defaultPageSize: 0,
a792eecf1614 Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1138
diff changeset
159 autoLoad: false,
a792eecf1614 Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1138
diff changeset
160 listeners: {
a792eecf1614 Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1138
diff changeset
161 beforeload: {
a792eecf1614 Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1138
diff changeset
162 fn: function() {
a792eecf1614 Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1138
diff changeset
163 osg.setLoading(true);
a792eecf1614 Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1138
diff changeset
164 map.setLoading(true);
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 },
a792eecf1614 Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1138
diff changeset
167 load: {
a792eecf1614 Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1138
diff changeset
168 fn: function() {
a792eecf1614 Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1138
diff changeset
169 osg.setLoading(false);
a792eecf1614 Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1138
diff changeset
170 map.setLoading(false);
1284
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
171 osg.setStore(me.ortstore);
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
172 map.addLocations(me.ortstore);
1279
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1274
diff changeset
173 map.featureLayer.setVisibility(false);
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1274
diff changeset
174 map.selectedFeatureLayer = new OpenLayers.Layer.Vector(
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1274
diff changeset
175 'gewählter Messpunkt', {
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1274
diff changeset
176 styleMap: new OpenLayers.StyleMap({
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1274
diff changeset
177 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
178 pointRadius: 10,
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1274
diff changeset
179 label: '${bez}',
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1274
diff changeset
180 labelAlign: 'rt',
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1274
diff changeset
181 fontColor: 'blue',
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1274
diff changeset
182 fontWeight: 'bold',
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1274
diff changeset
183 }),
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1274
diff changeset
184 displayInLayerSwitcher: false,
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1274
diff changeset
185 projection: new OpenLayers.Projection('EPSG:3857')
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1274
diff changeset
186 });
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1274
diff changeset
187 map.map.addLayer(map.selectedFeatureLayer);
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1274
diff changeset
188 map.selectedFeatureLayer.setZIndex(499);
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1274
diff changeset
189 var ortId = me.record.get('ortId');
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1274
diff changeset
190 if (ortId){
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1274
diff changeset
191 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
192 map.selectControl.select(feat);
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1274
diff changeset
193 }
1274
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 });
1284
faecbb446a04 Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents: 1279
diff changeset
198 this.ortstore.load();
1279
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1274
diff changeset
199 map.addListener('featureselected', osg.selectOrt, osg);
291df0037835 Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents: 1274
diff changeset
200 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
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 /**
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 * @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
205 * 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
206 */
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 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
208 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
209 var map = this.down('map');
a792eecf1614 Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1138
diff changeset
210 map.map.addControl(new OpenLayers.Control.LayerSwitcher());
1013
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 /**
75ce503ab296 Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
214 * 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
215 * @param errors These Errors shall be shown
75ce503ab296 Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
216 * @param warnings These Warning shall be shown
75ce503ab296 Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
217 */
75ce503ab296 Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
218 setMessages: function(errors, warnings) {
75ce503ab296 Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
219 //todo this is a stub
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 /**
75ce503ab296 Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
223 * 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
224 */
75ce503ab296 Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
225 clearMessages: function() {
75ce503ab296 Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
226 //todo this is a stub
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 });
75ce503ab296 Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
229

http://lada.wald.intevation.org