annotate app/view/form/Location.js @ 610:f240fe19ff5d

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

http://lada.wald.intevation.org