annotate app/view/form/Ort.js @ 681:f373446325b4

a probe can not be edited when the readonly flag was sent by the server
author Dustin Demuth <dustin@intevation.de>
date Tue, 24 Mar 2015 15:33:11 +0100
parents 9d0113bc2f70
children 2ad36c8db968
rev   line source
603
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
2 * Software engineering by Intevation GmbH
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
3 *
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
4 * This file is Free Software under the GNU GPL (v>=3)
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
6 * the documentation coming with IMIS-Labordaten-Application for details.
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
7 */
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
8
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
9 /*
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
10 * Formular to edit a Probe
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
11 */
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
12 Ext.define('Lada.view.form.Ort', {
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
13 extend: 'Ext.form.Panel',
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
14 alias: 'widget.ortform',
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
15
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
16 requires: [
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
17 'Lada.view.widget.Location'
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
18 ],
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
19
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
20 model: 'Lada.model.Ort',
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
21 minWidth: 300,
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
22 margin: 5,
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
23 border: 0,
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
24
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
25 recordId: null,
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
26
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
27 trackResetOnLoad: true,
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
28
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
29 initComponent: function() {
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
30 this.items = [{
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
31 xtype: 'fieldset',
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
32 title: 'Ort',
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
33 items: [{
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
34 border: 0,
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
35 margin: '0, 0, 10, 0',
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
36 dockedItems: [{
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
37 xtype: 'toolbar',
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
38 dock: 'bottom',
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
39 border: '0, 1, 1, 1',
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
40 style: {
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
41 borderBottom: '1px solid #b5b8c8 !important',
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
42 borderLeft: '1px solid #b5b8c8 !important',
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
43 borderRight: '1px solid #b5b8c8 !important'
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
44 },
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
45 items: ['->', {
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
46 text: 'Speichern',
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
47 qtip: 'Daten speichern',
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
48 icon: 'resources/img/dialog-ok-apply.png',
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
49 action: 'save',
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
50 disabled: true
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
51 }, {
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
52 text: 'Verwerfen',
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
53 qtip: 'Ă„nderungen verwerfen',
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
54 icon: 'resources/img/dialog-cancel.png',
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
55 action: 'discard',
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
56 disabled: true
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
57 }]
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
58 }],
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
59 items: [{
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
60 xtype: 'location',
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
61 name: 'ort',
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
62 fieldLabel: 'Ort',
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
63 labelWidth: 80,
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
64 width: 280
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
65 }, {
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
66 xtype: 'tfield',
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
67 name: 'ortsTyp',
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
68 fieldLabel: 'Typ',
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
69 labelWidth: 80,
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
70 width: 280,
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
71 maxLength: 1
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
72 }, {
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
73 xtype: 'textarea',
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
74 name: 'ortszusatztext',
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
75 fieldLabel: 'Ortszusatz',
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
76 width: 280,
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
77 labelWidth: 80
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
78 }]
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
79 }]
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
80 }];
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
81 this.callParent(arguments);
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
82 },
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
83
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
84 setRecord: function(record) {
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
85 this.getForm().loadRecord(record);
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
86 },
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
87
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
88 setMessages: function(errors, warnings) {
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
89 },
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
90
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
91 clearMessages: function() {
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
92 },
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
93
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
94 setReadOnly: function(value) {
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
95 }
9d0113bc2f70 Added ort form and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
96 });

http://lada.wald.intevation.org