comparison app/view/window/OrtEdit.js @ 606:2b2d284bd6e4

Added ort edit window.
author Raimund Renkert <raimund.renkert@intevation.de>
date Thu, 12 Mar 2015 15:53:04 +0100
parents
children 04e380ce4d73
comparison
equal deleted inserted replaced
605:c6994912a326 606:2b2d284bd6e4
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz
2 * Software engineering by Intevation GmbH
3 *
4 * This file is Free Software under the GNU GPL (v>=3)
5 * and comes with ABSOLUTELY NO WARRANTY! Check out
6 * the documentation coming with IMIS-Labordaten-Application for details.
7 */
8
9 /*
10 * Window to edit a Messung
11 */
12 Ext.define('Lada.view.window.OrtEdit', {
13 extend: 'Ext.window.Window',
14 alias: 'widget.ortedit',
15
16 requires: [
17 'Lada.view.panel.Map',
18 'Lada.view.form.Ort',
19 'Lada.view.form.Location'
20 ],
21
22 collapsible: true,
23 maximizable: true,
24 autoshow: true,
25 layout: 'border',
26
27 record: null,
28
29 initComponent: function() {
30 if (this.record === null) {
31 Ext.Msg.alert('Kein valider Ort ausgewählt!');
32 this.callParent(arguments);
33 return;
34 }
35 this.title = 'Ort';
36 this.buttons = [{
37 text: 'Schließen',
38 scope: this,
39 handler: this.close
40 }];
41 this.width = 900;
42 this.height = 515;
43 this.bodyStyle = {background: '#fff'};
44
45 this.items = [{
46 region: 'west',
47 border: 0,
48 layout: 'vbox',
49 items: [{
50 xtype: 'ortform',
51 margin: 5,
52 recordId: this.record.get('id')
53 }, {
54 xtype: 'locationform',
55 margin: 5,
56 recordId: this.record.get('id')
57 }]
58 }, {
59 xtype: 'fset',
60 bodyStyle: {
61 background: '#fff'
62 },
63 layout: 'border',
64 name: 'mapfield',
65 title: 'Karte',
66 region: 'center',
67 padding: '5, 5',
68 margin: 5,
69 items: [{
70 xtype: 'map',
71 region: 'center',
72 layout: 'border',
73 bodyStyle: {
74 background: '#fff'
75 },
76 name: 'map'
77 }]
78 }];
79 this.callParent(arguments);
80 },
81
82 initData: function() {
83 this.down('ortform').setRecord(this.record);
84 Ext.ClassManager.get('Lada.model.Location').load(this.record.get('ort'), {
85 failure: function(record, action) {
86 // TODO
87 },
88 success: function(record, response) {
89 this.down('locationform').setRecord(record);
90 this.down('locationform').setReadOnly(true);
91 },
92 scope: this
93 });
94 },
95
96 setMessages: function(errors, warnings) {
97 //todo this is a stub
98 },
99
100 clearMessages: function() {
101 //todo this is a stub
102 }
103 });

http://lada.wald.intevation.org