annotate app/view/window/OrtEdit.js @ 838:bbbccdb103cf

Display Time in Proben over Medium
author Dustin Demuth <dustin@intevation.de>
date Mon, 06 Jul 2015 16:50:30 +0200
parents 7267bae1d43f
children e5f72fb491f4
rev   line source
606
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
2 * Software engineering by Intevation GmbH
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
3 *
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
4 * This file is Free Software under the GNU GPL (v>=3)
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
6 * the documentation coming with IMIS-Labordaten-Application for details.
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
7 */
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
8
796
7267bae1d43f made window-panel recyclable, fwd openlayers events to ext
Dustin Demuth <dustin@intevation.de>
parents: 726
diff changeset
9 /**
7267bae1d43f made window-panel recyclable, fwd openlayers events to ext
Dustin Demuth <dustin@intevation.de>
parents: 726
diff changeset
10 * Window to edit a Ort
606
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
11 */
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
12 Ext.define('Lada.view.window.OrtEdit', {
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
13 extend: 'Ext.window.Window',
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
14 alias: 'widget.ortedit',
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
15
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
16 requires: [
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
17 'Lada.view.panel.Map',
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
18 'Lada.view.form.Ort',
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
19 'Lada.view.form.Location'
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
20 ],
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
21
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
22 collapsible: true,
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
23 maximizable: true,
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
24 autoshow: true,
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
25 layout: 'border',
688
6a6d1b02a1a3 constrain windows to viewport
Dustin Demuth <dustin@intevation.de>
parents: 644
diff changeset
26 constrain: true,
606
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
27
690
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
28 parentWindow: null,
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
29 probe: null,
606
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
30 record: null,
644
71e8b84d7829 Reload grids on messung or ort changed/added.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 614
diff changeset
31 grid: null,
606
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
32
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
33 initComponent: function() {
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
34 if (this.record === null) {
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
35 Ext.Msg.alert('Kein valider Ort ausgewählt!');
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
36 this.callParent(arguments);
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
37 return;
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
38 }
690
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
39 if (this.probe === null) {
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
40 Ext.Msg.alert('Zu dem Ort existiert keine Probe!');
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
41 this.callParent(arguments);
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
42 return;
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
43 }
606
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
44 this.title = 'Ort';
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
45 this.buttons = [{
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
46 text: 'Schließen',
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
47 scope: this,
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
48 handler: this.close
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
49 }];
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
50 this.width = 900;
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
51 this.height = 515;
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
52 this.bodyStyle = {background: '#fff'};
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
53
709
6f6d2df00130 Added some CSS to make distinction between active and inactice windows more simple for the user
Dustin Demuth <dustin@intevation.de>
parents: 690
diff changeset
54 // add listeners to change the window appearence when it becomes inactive
6f6d2df00130 Added some CSS to make distinction between active and inactice windows more simple for the user
Dustin Demuth <dustin@intevation.de>
parents: 690
diff changeset
55 this.on({
6f6d2df00130 Added some CSS to make distinction between active and inactice windows more simple for the user
Dustin Demuth <dustin@intevation.de>
parents: 690
diff changeset
56 activate: function(){
6f6d2df00130 Added some CSS to make distinction between active and inactice windows more simple for the user
Dustin Demuth <dustin@intevation.de>
parents: 690
diff changeset
57 this.getEl().removeCls('window-inactive');
6f6d2df00130 Added some CSS to make distinction between active and inactice windows more simple for the user
Dustin Demuth <dustin@intevation.de>
parents: 690
diff changeset
58 },
6f6d2df00130 Added some CSS to make distinction between active and inactice windows more simple for the user
Dustin Demuth <dustin@intevation.de>
parents: 690
diff changeset
59 deactivate: function(){
6f6d2df00130 Added some CSS to make distinction between active and inactice windows more simple for the user
Dustin Demuth <dustin@intevation.de>
parents: 690
diff changeset
60 this.getEl().addCls('window-inactive');
6f6d2df00130 Added some CSS to make distinction between active and inactice windows more simple for the user
Dustin Demuth <dustin@intevation.de>
parents: 690
diff changeset
61 }
6f6d2df00130 Added some CSS to make distinction between active and inactice windows more simple for the user
Dustin Demuth <dustin@intevation.de>
parents: 690
diff changeset
62 });
6f6d2df00130 Added some CSS to make distinction between active and inactice windows more simple for the user
Dustin Demuth <dustin@intevation.de>
parents: 690
diff changeset
63
606
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
64 this.items = [{
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
65 region: 'west',
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
66 border: 0,
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
67 layout: 'vbox',
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
68 items: [{
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
69 xtype: 'ortform',
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
70 margin: 5,
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
71 recordId: this.record.get('id')
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
72 }, {
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
73 xtype: 'locationform',
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
74 margin: 5,
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
75 recordId: this.record.get('id')
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
76 }]
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
77 }, {
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
78 xtype: 'fset',
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
79 bodyStyle: {
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
80 background: '#fff'
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
81 },
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
82 layout: 'border',
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
83 name: 'mapfield',
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
84 title: 'Karte',
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
85 region: 'center',
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
86 padding: '5, 5',
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
87 margin: 5,
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
88 items: [{
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
89 xtype: 'map',
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
90 region: 'center',
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
91 layout: 'border',
614
04e380ce4d73 Load locations as layer on the map, set selections based on the selected 'ort'.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 606
diff changeset
92 record: this.record,
606
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
93 bodyStyle: {
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
94 background: '#fff'
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
95 },
796
7267bae1d43f made window-panel recyclable, fwd openlayers events to ext
Dustin Demuth <dustin@intevation.de>
parents: 726
diff changeset
96 name: 'map',
7267bae1d43f made window-panel recyclable, fwd openlayers events to ext
Dustin Demuth <dustin@intevation.de>
parents: 726
diff changeset
97 listeners: { //A listener which listens to the mappanels featureselected event
7267bae1d43f made window-panel recyclable, fwd openlayers events to ext
Dustin Demuth <dustin@intevation.de>
parents: 726
diff changeset
98 featureselected: this.selectedFeature
7267bae1d43f made window-panel recyclable, fwd openlayers events to ext
Dustin Demuth <dustin@intevation.de>
parents: 726
diff changeset
99 }
606
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
100 }]
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
101 }];
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
102 this.callParent(arguments);
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
103 },
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
104
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
105 initData: function() {
690
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
106 Ext.ClassManager.get('Lada.model.Ort').load(this.record.get('id'), {
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
107 failure: function(record, action) {
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
108 // TODO
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
109 },
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
110 success: function(record, response) {
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
111 var me = this;
726
6bc05ba2f6b1 Fixed tree_modified check in orte edit.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 709
diff changeset
112 if (record.get('treeModified') < record.get('parentModified')) {
690
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
113 Ext.Msg.show({
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
114 title: 'Probe nicht aktuell!',
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
115 msg: 'Die zugehörige Probe wurde verändert.\nMöchten Sie zu der Probe zurückkehren und neu laden?\nOhne das erneute Laden der Probe wird das Speichern des Ortes nicht möglich sein.',
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
116 buttons: Ext.Msg.OKCANCEL,
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
117 icon: Ext.Msg.WARNING,
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
118 closable: false,
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
119 fn: function(button) {
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
120 if (button === 'ok') {
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
121 me.close();
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
122 me.parentWindow.initData();
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
123 }
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
124 else {
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
125 me.record.set('treeModified', me.probe.get('treeModified'));
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
126 }
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
127 }
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
128 });
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
129 }
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
130 this.down('ortform').setRecord(record);
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
131 this.record = record;
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
132 },
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
133 scope: this
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
134 });
606
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
135 Ext.ClassManager.get('Lada.model.Location').load(this.record.get('ort'), {
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
136 failure: function(record, action) {
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
137 // TODO
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
138 },
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
139 success: function(record, response) {
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
140 this.down('locationform').setRecord(record);
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
141 this.down('locationform').setReadOnly(true);
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
142 },
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
143 scope: this
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
144 });
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
145 },
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
146
796
7267bae1d43f made window-panel recyclable, fwd openlayers events to ext
Dustin Demuth <dustin@intevation.de>
parents: 726
diff changeset
147 /**
7267bae1d43f made window-panel recyclable, fwd openlayers events to ext
Dustin Demuth <dustin@intevation.de>
parents: 726
diff changeset
148 * @private
7267bae1d43f made window-panel recyclable, fwd openlayers events to ext
Dustin Demuth <dustin@intevation.de>
parents: 726
diff changeset
149 * Override to display and update the map view in the panel.
7267bae1d43f made window-panel recyclable, fwd openlayers events to ext
Dustin Demuth <dustin@intevation.de>
parents: 726
diff changeset
150 */
7267bae1d43f made window-panel recyclable, fwd openlayers events to ext
Dustin Demuth <dustin@intevation.de>
parents: 726
diff changeset
151 afterRender: function(){
7267bae1d43f made window-panel recyclable, fwd openlayers events to ext
Dustin Demuth <dustin@intevation.de>
parents: 726
diff changeset
152 this.superclass.afterRender.apply(this, arguments);
7267bae1d43f made window-panel recyclable, fwd openlayers events to ext
Dustin Demuth <dustin@intevation.de>
parents: 726
diff changeset
153 var map = this.down('map');
7267bae1d43f made window-panel recyclable, fwd openlayers events to ext
Dustin Demuth <dustin@intevation.de>
parents: 726
diff changeset
154 if (this.record) {
7267bae1d43f made window-panel recyclable, fwd openlayers events to ext
Dustin Demuth <dustin@intevation.de>
parents: 726
diff changeset
155 map.selectFeature(this.record.get('ort'));
7267bae1d43f made window-panel recyclable, fwd openlayers events to ext
Dustin Demuth <dustin@intevation.de>
parents: 726
diff changeset
156 }
7267bae1d43f made window-panel recyclable, fwd openlayers events to ext
Dustin Demuth <dustin@intevation.de>
parents: 726
diff changeset
157 else {
7267bae1d43f made window-panel recyclable, fwd openlayers events to ext
Dustin Demuth <dustin@intevation.de>
parents: 726
diff changeset
158 map.map.zoomToMaxExtent();
7267bae1d43f made window-panel recyclable, fwd openlayers events to ext
Dustin Demuth <dustin@intevation.de>
parents: 726
diff changeset
159 }
7267bae1d43f made window-panel recyclable, fwd openlayers events to ext
Dustin Demuth <dustin@intevation.de>
parents: 726
diff changeset
160 },
7267bae1d43f made window-panel recyclable, fwd openlayers events to ext
Dustin Demuth <dustin@intevation.de>
parents: 726
diff changeset
161
7267bae1d43f made window-panel recyclable, fwd openlayers events to ext
Dustin Demuth <dustin@intevation.de>
parents: 726
diff changeset
162 /**
7267bae1d43f made window-panel recyclable, fwd openlayers events to ext
Dustin Demuth <dustin@intevation.de>
parents: 726
diff changeset
163 * This function is used by the MapPanel, when a Feature was selected
7267bae1d43f made window-panel recyclable, fwd openlayers events to ext
Dustin Demuth <dustin@intevation.de>
parents: 726
diff changeset
164 */
7267bae1d43f made window-panel recyclable, fwd openlayers events to ext
Dustin Demuth <dustin@intevation.de>
parents: 726
diff changeset
165 selectedFeature: function(context, args) {
7267bae1d43f made window-panel recyclable, fwd openlayers events to ext
Dustin Demuth <dustin@intevation.de>
parents: 726
diff changeset
166 var feature = args[0];
7267bae1d43f made window-panel recyclable, fwd openlayers events to ext
Dustin Demuth <dustin@intevation.de>
parents: 726
diff changeset
167 if (feature.attributes.id &&
7267bae1d43f made window-panel recyclable, fwd openlayers events to ext
Dustin Demuth <dustin@intevation.de>
parents: 726
diff changeset
168 feature.attributes.id !== '') {
7267bae1d43f made window-panel recyclable, fwd openlayers events to ext
Dustin Demuth <dustin@intevation.de>
parents: 726
diff changeset
169 var record = Ext.data.StoreManager.get('locations').getById(feature.attributes.id);
7267bae1d43f made window-panel recyclable, fwd openlayers events to ext
Dustin Demuth <dustin@intevation.de>
parents: 726
diff changeset
170 context.up('window').down('locationform').setRecord(record);
7267bae1d43f made window-panel recyclable, fwd openlayers events to ext
Dustin Demuth <dustin@intevation.de>
parents: 726
diff changeset
171 context.up('window').down('locationform').setReadOnly(true);
7267bae1d43f made window-panel recyclable, fwd openlayers events to ext
Dustin Demuth <dustin@intevation.de>
parents: 726
diff changeset
172 context.up('window').down('ortform').down('combobox').setValue(record.id);
7267bae1d43f made window-panel recyclable, fwd openlayers events to ext
Dustin Demuth <dustin@intevation.de>
parents: 726
diff changeset
173 }
7267bae1d43f made window-panel recyclable, fwd openlayers events to ext
Dustin Demuth <dustin@intevation.de>
parents: 726
diff changeset
174 else {
7267bae1d43f made window-panel recyclable, fwd openlayers events to ext
Dustin Demuth <dustin@intevation.de>
parents: 726
diff changeset
175 context.up('window').down('locationform').setRecord(this.locationRecord);
7267bae1d43f made window-panel recyclable, fwd openlayers events to ext
Dustin Demuth <dustin@intevation.de>
parents: 726
diff changeset
176 context.up('window').down('locationform').setReadOnly(false);
7267bae1d43f made window-panel recyclable, fwd openlayers events to ext
Dustin Demuth <dustin@intevation.de>
parents: 726
diff changeset
177 }
7267bae1d43f made window-panel recyclable, fwd openlayers events to ext
Dustin Demuth <dustin@intevation.de>
parents: 726
diff changeset
178 },
7267bae1d43f made window-panel recyclable, fwd openlayers events to ext
Dustin Demuth <dustin@intevation.de>
parents: 726
diff changeset
179
606
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
180 setMessages: function(errors, warnings) {
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
181 //todo this is a stub
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
182 },
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
183
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
184 clearMessages: function() {
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
185 //todo this is a stub
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
186 }
2b2d284bd6e4 Added ort edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
187 });

http://lada.wald.intevation.org