comparison app/view/form/Location.js @ 604:2f17dd53e69f

Added form for locations.
author Raimund Renkert <raimund.renkert@intevation.de>
date Thu, 12 Mar 2015 15:51:54 +0100
parents
children fe527f380b10
comparison
equal deleted inserted replaced
603:9d0113bc2f70 604:2f17dd53e69f
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 * Formular to edit a Probe
11 */
12 Ext.define('Lada.view.form.Location', {
13 extend: 'Ext.form.Panel',
14 alias: 'widget.locationform',
15
16 requires: [
17 'Lada.view.widget.Verwaltungseinheit',
18 'Lada.view.widget.Staat'
19 ],
20
21 model: 'Lada.model.Ort',
22 minWidth: 300,
23 margin: 5,
24 border: 0,
25
26 recordId: null,
27
28 trackResetOnLoad: true,
29
30 initComponent: function() {
31 this.items = [{
32 xtype: 'fieldset',
33 title: 'Details',
34 items: [{
35 border: 0,
36 margin: '0, 0, 10, 0',
37 dockedItems: [{
38 xtype: 'toolbar',
39 dock: 'bottom',
40 border: '0, 1, 1, 1',
41 style: {
42 borderBottom: '1px solid #b5b8c8 !important',
43 borderLeft: '1px solid #b5b8c8 !important',
44 borderRight: '1px solid #b5b8c8 !important'
45 },
46 items: ['->', {
47 text: 'Speichern',
48 qtip: 'Daten speichern',
49 icon: 'resources/img/dialog-ok-apply.png',
50 action: 'save',
51 disabled: true
52 }, {
53 text: 'Verwerfen',
54 qtip: 'Änderungen verwerfen',
55 icon: 'resources/img/dialog-cancel.png',
56 action: 'discard',
57 disabled: true
58 }]
59 }],
60 items: [{
61 xtype: 'tfield',
62 maxLength: 100,
63 name: 'beschreibung',
64 fieldLabel: 'Beschreibung',
65 width: 280,
66 labelWidth: 80
67 }, {
68 xtype: 'tfield',
69 maxLength: 10,
70 name: 'bezeichnung',
71 fieldLabel: 'Bezeichnung',
72 width: 280,
73 labelWidth: 80
74 }, {
75 xtype: 'staat',
76 name: 'staatId',
77 fieldLabel: 'Staat',
78 width: 280,
79 labelWidth: 80
80 }, {
81 xtype: 'verwaltungseinheit',
82 name: 'verwaltungseinheitId',
83 fieldLabel: 'Gemeinde',
84 width: 280,
85 labelWidth: 80
86 }, {
87 xtype: 'numberfield',
88 name: 'latitude',
89 fieldLabel: 'Lat',
90 width: 280,
91 labelWidth: 80
92 }, {
93 xtype: 'numberfield',
94 name: 'longitude',
95 fieldLabel: 'Lon',
96 width: 280,
97 labelWidth: 80
98 }, {
99 xtype: 'numberfield',
100 name: 'hoeheLand',
101 fieldLabel: 'Höhe',
102 width: 280,
103 labelWidth: 80
104 }]
105 }]
106 }];
107 this.callParent(arguments);
108 },
109
110 setRecord: function(record) {
111 this.getForm().loadRecord(record);
112 },
113
114 setMessages: function(errors, warnings) {
115 },
116
117 clearMessages: function() {
118 },
119
120 setReadOnly: function(value) {
121 this.down('tfield[name=beschreibung]').setReadOnly(value);
122 this.down('tfield[name=bezeichnung]').setReadOnly(value);
123 this.down('staat[name=staatId]').setReadOnly(value);
124 this.down('verwaltungseinheit[name=verwaltungseinheitId]').setReadOnly(value);
125 this.down('numberfield[name=longitude]').setReadOnly(value);
126 this.down('numberfield[name=latitude]').setReadOnly(value);
127 this.down('numberfield[name=hoeheLand]').setReadOnly(value);
128 }
129 });

http://lada.wald.intevation.org