Mercurial > lada > lada-client
annotate app/view/window/Ortszuordnung.js @ 1274:a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Tue, 10 Jan 2017 10:03:57 +0100 |
parents | a3a715417540 |
children | 291df0037835 |
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', |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
18 'Lada.view.panel.Ort' |
1013
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
19 ], |
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 collapsible: true, |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
22 maximizable: true, |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
23 autoshow: true, |
1274
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
24 layout: 'fit', |
1013
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
25 constrain: true, |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
26 |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
27 probe: null, |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
28 parentWindow: null, |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
29 record: null, |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
30 grid: null, |
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 /** |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
33 * This function initialises the Window |
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 initComponent: function() { |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
36 var i18n = Lada.getApplication().bundle; |
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 this.title = i18n.getMsg('ortszuordnung.window.title'); |
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 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
|
41 // A record be edited |
1013
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
42 this.title = i18n.getMsg('ortszuordnung.window.title') |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
43 + ' ' |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
44 + i18n.getMsg('ortszuordnung.window.title2') |
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('probe') |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
47 + ' ' |
1138
a3a715417540
Fixed typo in datafield getter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1134
diff
changeset
|
48 + this.probe.get('hauptprobenNr') |
1013
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
49 + ' ' |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
50 + i18n.getMsg('edit'); |
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 else if (this.probe) { |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
53 // A new record will be created |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
54 this.title = i18n.getMsg('ortszuordnung.window.title') |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
55 + ' ' |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
56 + i18n.getMsg('ortszuordnung.window.title2') |
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('probe') |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
59 + ' ' |
1138
a3a715417540
Fixed typo in datafield getter.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1134
diff
changeset
|
60 + this.probe.get('hauptprobenNr') |
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('create'); |
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 |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
65 this.buttons = [{ |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
66 text: i18n.getMsg('close'), |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
67 scope: this, |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
68 handler: this.close |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
69 }]; |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
70 this.width = 900; |
1274
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
71 this.height = 465; |
1013
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
72 this.bodyStyle = {background: '#fff'}; |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
73 |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
74 // 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
|
75 this.on({ |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
76 activate: function(){ |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
77 this.getEl().removeCls('window-inactive'); |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
78 }, |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
79 deactivate: function(){ |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
80 this.getEl().addCls('window-inactive'); |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
81 } |
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 |
1274
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
84 |
1013
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, |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
106 maxHeight: '45%', |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
107 items: [{ |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
108 xtype: 'ortstammdatengrid', |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
109 maxHeight: '45%' |
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'), |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
126 action: 'createort', |
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'), |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
129 action: 'frommap', |
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'), |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
132 action: 'clone', |
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 text: i18n.getMsg('orte.select'), |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
135 action: 'select', |
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 }] |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
138 }] |
1013
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 this.callParent(arguments); |
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 /** |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
144 * Initialise the Data of this Window |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
145 */ |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
146 initData: function() { |
1274
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
147 var me = this; |
1134
f1d21e6a7449
Fixed adding new ortszuortnung for probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1133
diff
changeset
|
148 if (!this.record) { |
f1d21e6a7449
Fixed adding new ortszuortnung for probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1133
diff
changeset
|
149 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
|
150 if (!this.record.get('letzteAenderung')) { |
f1d21e6a7449
Fixed adding new ortszuortnung for probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1133
diff
changeset
|
151 this.record.data.letzteAenderung = new Date(); |
f1d21e6a7449
Fixed adding new ortszuortnung for probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1133
diff
changeset
|
152 } |
f1d21e6a7449
Fixed adding new ortszuortnung for probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1133
diff
changeset
|
153 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
|
154 } |
1013
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
155 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
|
156 var map = this.down('map'); |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
157 var osg = this.down('ortstammdatengrid'); |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
158 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
|
159 defaultPageSize: 0, |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
160 autoLoad: false, |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
161 listeners: { |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
162 beforeload: { |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
163 fn: function() { |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
164 osg.setLoading(true); |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
165 map.setLoading(true); |
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 }, |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
168 load: { |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
169 fn: function() { |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
170 osg.setLoading(false); |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
171 map.setLoading(false); |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
172 osg.setStore(ortstore); |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
173 var store = Ext.create('Lada.store.Orte', { |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
174 autoLoad: false |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
175 }); |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
176 store.add(ortstore.getRange()); |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
177 var rec = store.getById(me.record.get('ortId')); |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
178 store.remove(rec); |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
179 console.log(rec); |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
180 map.addLocations(store); |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
181 } |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
182 } |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
183 } |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
184 }); |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
185 ortstore.load(); |
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
|
186 }, |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
187 |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
188 /** |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
189 * @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
|
190 * 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
|
191 */ |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
192 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
|
193 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
|
194 var map = this.down('map'); |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
195 map.map.addControl(new OpenLayers.Control.LayerSwitcher()); |
a792eecf1614
Updated Layout and Map for 'ortsbezug'-window. WIP!
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1138
diff
changeset
|
196 //map.map.zoomToMaxExtent(); |
1013
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
197 }, |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
198 |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
199 /** |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
200 * 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
|
201 * @param errors These Errors shall be shown |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
202 * @param warnings These Warning shall be shown |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
203 */ |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
204 setMessages: function(errors, warnings) { |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
205 //todo this is a stub |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
206 }, |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
207 |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
208 /** |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
209 * 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
|
210 */ |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
211 clearMessages: function() { |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
212 //todo this is a stub |
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 }); |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
215 |