Mercurial > lada > lada-client
annotate app/view/form/Messung.js @ 960:73b397d8dd3a
Hide Status Fields when creating a new messung
author | Dustin Demuth <dustin@intevation.de> |
---|---|
date | Tue, 10 Nov 2015 12:16:19 +0100 |
parents | 5d57c6c53e20 |
children | 6f1cc3316e2d |
rev | line source |
---|---|
581
424802824648
Added a form for Messungen (unfinished)
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz |
424802824648
Added a form for Messungen (unfinished)
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
2 * Software engineering by Intevation GmbH |
424802824648
Added a form for Messungen (unfinished)
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
3 * |
424802824648
Added a form for Messungen (unfinished)
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
4 * This file is Free Software under the GNU GPL (v>=3) |
424802824648
Added a form for Messungen (unfinished)
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out |
424802824648
Added a form for Messungen (unfinished)
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
6 * the documentation coming with IMIS-Labordaten-Application for details. |
424802824648
Added a form for Messungen (unfinished)
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
7 */ |
424802824648
Added a form for Messungen (unfinished)
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
8 |
894 | 9 /** |
10 * Form to edit a Messung | |
581
424802824648
Added a form for Messungen (unfinished)
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
11 */ |
424802824648
Added a form for Messungen (unfinished)
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
12 Ext.define('Lada.view.form.Messung', { |
424802824648
Added a form for Messungen (unfinished)
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
13 extend: 'Ext.form.Panel', |
424802824648
Added a form for Messungen (unfinished)
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
14 alias: 'widget.messungform', |
424802824648
Added a form for Messungen (unfinished)
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
15 requires: [ |
424802824648
Added a form for Messungen (unfinished)
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
16 'Lada.view.widget.Datenbasis', |
611
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
17 'Lada.view.widget.base.CheckBox', |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
18 'Lada.view.widget.Messmethode', |
581
424802824648
Added a form for Messungen (unfinished)
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
19 'Lada.view.widget.base.TextField', |
882 | 20 'Lada.view.widget.base.Datetime' |
581
424802824648
Added a form for Messungen (unfinished)
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
21 ], |
424802824648
Added a form for Messungen (unfinished)
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
22 |
424802824648
Added a form for Messungen (unfinished)
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
23 model: 'Lada.model.Messung', |
424802824648
Added a form for Messungen (unfinished)
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
24 minWidth: 650, |
424802824648
Added a form for Messungen (unfinished)
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
25 margin: 5, |
424802824648
Added a form for Messungen (unfinished)
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
26 border: 0, |
424802824648
Added a form for Messungen (unfinished)
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
27 |
424802824648
Added a form for Messungen (unfinished)
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
28 recordId: null, |
424802824648
Added a form for Messungen (unfinished)
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
29 |
424802824648
Added a form for Messungen (unfinished)
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
30 trackResetOnLoad: true, |
424802824648
Added a form for Messungen (unfinished)
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
31 |
589 | 32 initComponent: function() { |
611
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
33 var me = this; |
581
424802824648
Added a form for Messungen (unfinished)
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
34 this.items = [{ |
424802824648
Added a form for Messungen (unfinished)
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
35 xtype: 'fieldset', |
611
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
36 title: 'Allgemein', |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
37 items: [{ |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
38 border: 0, |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
39 margin: '0, 0, 10, 0', |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
40 layout: { |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
41 type: 'table', |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
42 columns: 2 |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
43 }, |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
44 dockedItems: [{ |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
45 xtype: 'toolbar', |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
46 dock: 'bottom', |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
47 border: '0, 1, 1, 1', |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
48 style: { |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
49 borderBottom: '1px solid #b5b8c8 !important', |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
50 borderLeft: '1px solid #b5b8c8 !important', |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
51 borderRight: '1px solid #b5b8c8 !important' |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
52 }, |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
53 items: ['->', { |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
54 text: 'Speichern', |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
55 qtip: 'Daten speichern', |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
56 icon: 'resources/img/dialog-ok-apply.png', |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
57 action: 'save', |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
58 disabled: true |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
59 }, { |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
60 text: 'Verwerfen', |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
61 qtip: 'Ă„nderungen verwerfen', |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
62 icon: 'resources/img/dialog-cancel.png', |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
63 action: 'discard', |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
64 disabled: true |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
65 }] |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
66 }], |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
67 items: [{ |
708
2ad36c8db968
Added ClearMessages, SetWarnigs, SetReadonly
Dustin Demuth <dustin@intevation.de>
parents:
694
diff
changeset
|
68 xtype: 'tfield', |
611
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
69 name: 'nebenprobenNr', |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
70 maxLength: 10, |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
71 margin: '0, 10, 5, 0', |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
72 fieldLabel: 'Nebenprobennr.', |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
73 width: 300, |
718
7f11b75e0188
Trailing Commas, editable: false for Umwelt und Messstelle widget
Dustin Demuth <dustin@intevation.de>
parents:
715
diff
changeset
|
74 labelWidth: 100 |
611
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
75 }, { |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
76 xtype: 'messmethode', |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
77 name: 'mmtId', |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
78 margin: '0, 10, 5, 0', |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
79 fieldLabel: 'Messmethode', |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
80 width: 300, |
718
7f11b75e0188
Trailing Commas, editable: false for Umwelt und Messstelle widget
Dustin Demuth <dustin@intevation.de>
parents:
715
diff
changeset
|
81 labelWidth: 100 |
611
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
82 }, { |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
83 xtype: 'datetime', |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
84 name: 'messzeitpunkt', |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
85 margin: '0, 10, 5, 0', |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
86 fieldLabel: 'Messzeitpunkt', |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
87 width: 300, |
718
7f11b75e0188
Trailing Commas, editable: false for Umwelt und Messstelle widget
Dustin Demuth <dustin@intevation.de>
parents:
715
diff
changeset
|
88 labelWidth: 100 |
611
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
89 }, { |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
90 xtype: 'numberfield', |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
91 allowDecimals: false, |
661
04cf6b514e3e
Enforcing maxlength on Numberfield Messdauer
Dustin Demuth <dustin@intevation.de>
parents:
611
diff
changeset
|
92 allowExponential: false, |
04cf6b514e3e
Enforcing maxlength on Numberfield Messdauer
Dustin Demuth <dustin@intevation.de>
parents:
611
diff
changeset
|
93 enforceMaxLength: true, |
04cf6b514e3e
Enforcing maxlength on Numberfield Messdauer
Dustin Demuth <dustin@intevation.de>
parents:
611
diff
changeset
|
94 maxLength: 10, |
611
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
95 minValue: 0, |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
96 name: 'messdauer', |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
97 margin: '0, 10, 5, 0', |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
98 fieldLabel: 'Messdauer', |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
99 width: 300, |
718
7f11b75e0188
Trailing Commas, editable: false for Umwelt und Messstelle widget
Dustin Demuth <dustin@intevation.de>
parents:
715
diff
changeset
|
100 labelWidth: 100 |
611
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
101 }, { |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
102 xtype: 'chkbox', |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
103 name: 'fertig', |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
104 margin: '0, 10, 5, 0', |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
105 fieldLabel: 'Fertig', |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
106 width: 300, |
718
7f11b75e0188
Trailing Commas, editable: false for Umwelt und Messstelle widget
Dustin Demuth <dustin@intevation.de>
parents:
715
diff
changeset
|
107 labelWidth: 100 |
611
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
108 }, { |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
109 xtype: 'chkbox', |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
110 name: 'geplant', |
854
a031b98c7edc
Geplant-Checkbox for Messungen is now ReadOnly
Dustin Demuth <dustin@intevation.de>
parents:
718
diff
changeset
|
111 readOnly: true, |
611
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
112 margin: '0, 10, 5, 0', |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
113 fieldLabel: 'Geplant', |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
114 width: 300, |
718
7f11b75e0188
Trailing Commas, editable: false for Umwelt und Messstelle widget
Dustin Demuth <dustin@intevation.de>
parents:
715
diff
changeset
|
115 labelWidth: 100 |
945
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
894
diff
changeset
|
116 }, { |
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
894
diff
changeset
|
117 xtype: 'textfield', |
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
894
diff
changeset
|
118 name: 'status', |
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
894
diff
changeset
|
119 readOnly: true, |
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
894
diff
changeset
|
120 isFormField: false, |
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
894
diff
changeset
|
121 maxLength: 10, |
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
894
diff
changeset
|
122 margin: '0, 10, 5, 0', |
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
894
diff
changeset
|
123 fieldLabel: 'Status', |
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
894
diff
changeset
|
124 width: 300, |
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
894
diff
changeset
|
125 labelWidth: 100, |
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
894
diff
changeset
|
126 submitValue: false, |
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
894
diff
changeset
|
127 isFormField: false, |
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
894
diff
changeset
|
128 preventMark: true, //Do not display error msg. |
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
894
diff
changeset
|
129 validateValue: function() { |
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
894
diff
changeset
|
130 return true; //this field is always valid |
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
894
diff
changeset
|
131 }, |
957
881984972e0e
Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
132 }, { |
881984972e0e
Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
133 xtype: 'textfield', |
881984972e0e
Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
134 name: 'stufe', |
881984972e0e
Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
135 readOnly: true, |
881984972e0e
Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
136 isFormField: false, |
881984972e0e
Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
137 maxLength: 10, |
881984972e0e
Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
138 margin: '0, 10, 5, 0', |
881984972e0e
Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
139 fieldLabel: 'Stufe', |
881984972e0e
Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
140 width: 300, |
881984972e0e
Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
141 labelWidth: 100, |
881984972e0e
Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
142 submitValue: false, |
881984972e0e
Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
143 isFormField: false, |
881984972e0e
Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
144 preventMark: true, //Do not display error msg. |
881984972e0e
Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
145 validateValue: function() { |
881984972e0e
Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
146 return true; //this field is always valid |
881984972e0e
Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
147 }, |
611
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
148 }] |
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
589
diff
changeset
|
149 }] |
581
424802824648
Added a form for Messungen (unfinished)
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
150 }]; |
424802824648
Added a form for Messungen (unfinished)
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
151 this.callParent(arguments); |
424802824648
Added a form for Messungen (unfinished)
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
152 }, |
424802824648
Added a form for Messungen (unfinished)
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
153 |
589 | 154 setRecord: function(record) { |
960
73b397d8dd3a
Hide Status Fields when creating a new messung
Dustin Demuth <dustin@intevation.de>
parents:
958
diff
changeset
|
155 var form = this.getForm(); |
73b397d8dd3a
Hide Status Fields when creating a new messung
Dustin Demuth <dustin@intevation.de>
parents:
958
diff
changeset
|
156 form.loadRecord(record); |
73b397d8dd3a
Hide Status Fields when creating a new messung
Dustin Demuth <dustin@intevation.de>
parents:
958
diff
changeset
|
157 if (record.getId()){ |
73b397d8dd3a
Hide Status Fields when creating a new messung
Dustin Demuth <dustin@intevation.de>
parents:
958
diff
changeset
|
158 this.retrieveStatus(record.id, record.get('status')); |
73b397d8dd3a
Hide Status Fields when creating a new messung
Dustin Demuth <dustin@intevation.de>
parents:
958
diff
changeset
|
159 } |
73b397d8dd3a
Hide Status Fields when creating a new messung
Dustin Demuth <dustin@intevation.de>
parents:
958
diff
changeset
|
160 else { |
73b397d8dd3a
Hide Status Fields when creating a new messung
Dustin Demuth <dustin@intevation.de>
parents:
958
diff
changeset
|
161 //remove the StatusWert and StatusStufe field from the form |
73b397d8dd3a
Hide Status Fields when creating a new messung
Dustin Demuth <dustin@intevation.de>
parents:
958
diff
changeset
|
162 var sw = this.down('[name=status]'); |
73b397d8dd3a
Hide Status Fields when creating a new messung
Dustin Demuth <dustin@intevation.de>
parents:
958
diff
changeset
|
163 var ss = this.down('[name=stufe]'); |
73b397d8dd3a
Hide Status Fields when creating a new messung
Dustin Demuth <dustin@intevation.de>
parents:
958
diff
changeset
|
164 ss.hide(); |
73b397d8dd3a
Hide Status Fields when creating a new messung
Dustin Demuth <dustin@intevation.de>
parents:
958
diff
changeset
|
165 sw.hide(); |
73b397d8dd3a
Hide Status Fields when creating a new messung
Dustin Demuth <dustin@intevation.de>
parents:
958
diff
changeset
|
166 } |
945
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
894
diff
changeset
|
167 }, |
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
894
diff
changeset
|
168 |
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
894
diff
changeset
|
169 retrieveStatus: function(messungsId, statusId) { |
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
894
diff
changeset
|
170 var i18n = Lada.getApplication().bundle; |
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
894
diff
changeset
|
171 var msg = i18n.getMsg('load.statuswert'); |
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
894
diff
changeset
|
172 var textfield = this.down('[name=status]'); |
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
894
diff
changeset
|
173 |
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
894
diff
changeset
|
174 textfield.setRawValue(msg); |
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
894
diff
changeset
|
175 |
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
894
diff
changeset
|
176 var sStore = Ext.StoreManager.lookup('Status'); |
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
894
diff
changeset
|
177 if (!sStore) { |
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
894
diff
changeset
|
178 sStore = Ext.create('Lada.store.Status'); |
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
894
diff
changeset
|
179 } |
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
894
diff
changeset
|
180 sStore.on('load', |
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
894
diff
changeset
|
181 function(records, operation, success) { |
957
881984972e0e
Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
182 var sw, ss; |
945
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
894
diff
changeset
|
183 var i18n = Lada.getApplication().bundle; |
950
c7bf0b459074
Fixed some issues when the status is null
Dustin Demuth <dustin@intevation.de>
parents:
945
diff
changeset
|
184 if (sStore.getTotalCount() === 0 || !statusId) { |
957
881984972e0e
Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
185 sw = 0; |
945
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
894
diff
changeset
|
186 } |
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
894
diff
changeset
|
187 else { |
957
881984972e0e
Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
188 sw = sStore.getById(statusId).get('statusWert'); |
881984972e0e
Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
189 ss = sStore.getById(statusId).get('statusStufe'); |
945
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
894
diff
changeset
|
190 } |
957
881984972e0e
Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
191 this.setStatusWert(sw); |
881984972e0e
Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
192 this.setStatusStufe(ss); |
945
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
894
diff
changeset
|
193 }, |
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
894
diff
changeset
|
194 this); |
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
894
diff
changeset
|
195 sStore.load({ |
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
894
diff
changeset
|
196 params: { |
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
894
diff
changeset
|
197 messungsId: messungsId |
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
894
diff
changeset
|
198 } |
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
894
diff
changeset
|
199 }); |
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
894
diff
changeset
|
200 }, |
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
894
diff
changeset
|
201 |
957
881984972e0e
Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
202 /** |
881984972e0e
Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
203 * Updates the Messungform and fills the Statuswert |
881984972e0e
Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
204 */ |
945
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
894
diff
changeset
|
205 setStatusWert: function(value){ |
958
5d57c6c53e20
Made the grids more robust against erroneous data
Dustin Demuth <dustin@intevation.de>
parents:
957
diff
changeset
|
206 var swStore = Ext.create('Lada.store.StatusWerte'); |
955
b401846e7817
using callback differently for statuswerte
Dustin Demuth <dustin@intevation.de>
parents:
950
diff
changeset
|
207 swStore.load({ |
b401846e7817
using callback differently for statuswerte
Dustin Demuth <dustin@intevation.de>
parents:
950
diff
changeset
|
208 scope: this, |
b401846e7817
using callback differently for statuswerte
Dustin Demuth <dustin@intevation.de>
parents:
950
diff
changeset
|
209 callback: function(records, operation, success) { |
945
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
894
diff
changeset
|
210 var i18n = Lada.getApplication().bundle; |
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
894
diff
changeset
|
211 var msg = i18n.getMsg('load.statuswert.error'); |
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
894
diff
changeset
|
212 var textfield = this.down('[name=status]'); |
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
894
diff
changeset
|
213 if (success) { |
957
881984972e0e
Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
214 var item = swStore.getById(value); |
881984972e0e
Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
215 if (item) { |
881984972e0e
Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
216 msg = item.get('wert'); |
881984972e0e
Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
217 } |
881984972e0e
Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
218 } |
881984972e0e
Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
219 textfield.setRawValue(msg); |
881984972e0e
Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
220 }, |
881984972e0e
Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
221 }); |
881984972e0e
Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
222 }, |
881984972e0e
Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
223 |
881984972e0e
Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
224 /** |
881984972e0e
Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
225 * Updates the Messungform and fills the StatusStufe |
881984972e0e
Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
226 */ |
881984972e0e
Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
227 setStatusStufe: function(value){ |
958
5d57c6c53e20
Made the grids more robust against erroneous data
Dustin Demuth <dustin@intevation.de>
parents:
957
diff
changeset
|
228 var ssStore = Ext.create('Lada.store.StatusStufe'); |
957
881984972e0e
Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
229 ssStore.load({ |
881984972e0e
Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
230 scope: this, |
881984972e0e
Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
231 callback: function(records, operation, success) { |
881984972e0e
Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
232 var i18n = Lada.getApplication().bundle; |
881984972e0e
Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
233 var msg = i18n.getMsg('load.statusstufe.error'); |
881984972e0e
Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
234 var textfield = this.down('[name=stufe]'); |
881984972e0e
Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
235 if (success) { |
881984972e0e
Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
236 var item = ssStore.getById(value); |
881984972e0e
Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
237 if (item) { |
881984972e0e
Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
238 msg = item.get('stufe'); |
881984972e0e
Added Statusstufe to MessungForm
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
239 } |
945
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
894
diff
changeset
|
240 } |
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
894
diff
changeset
|
241 textfield.setRawValue(msg); |
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
894
diff
changeset
|
242 }, |
955
b401846e7817
using callback differently for statuswerte
Dustin Demuth <dustin@intevation.de>
parents:
950
diff
changeset
|
243 }); |
581
424802824648
Added a form for Messungen (unfinished)
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
244 }, |
424802824648
Added a form for Messungen (unfinished)
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
245 |
708
2ad36c8db968
Added ClearMessages, SetWarnigs, SetReadonly
Dustin Demuth <dustin@intevation.de>
parents:
694
diff
changeset
|
246 setMessages: function(errors, warnings) { |
2ad36c8db968
Added ClearMessages, SetWarnigs, SetReadonly
Dustin Demuth <dustin@intevation.de>
parents:
694
diff
changeset
|
247 var key; |
2ad36c8db968
Added ClearMessages, SetWarnigs, SetReadonly
Dustin Demuth <dustin@intevation.de>
parents:
694
diff
changeset
|
248 var element; |
2ad36c8db968
Added ClearMessages, SetWarnigs, SetReadonly
Dustin Demuth <dustin@intevation.de>
parents:
694
diff
changeset
|
249 var content; |
2ad36c8db968
Added ClearMessages, SetWarnigs, SetReadonly
Dustin Demuth <dustin@intevation.de>
parents:
694
diff
changeset
|
250 var i18n = Lada.getApplication().bundle; |
2ad36c8db968
Added ClearMessages, SetWarnigs, SetReadonly
Dustin Demuth <dustin@intevation.de>
parents:
694
diff
changeset
|
251 if (warnings) { |
2ad36c8db968
Added ClearMessages, SetWarnigs, SetReadonly
Dustin Demuth <dustin@intevation.de>
parents:
694
diff
changeset
|
252 for (key in warnings) { |
2ad36c8db968
Added ClearMessages, SetWarnigs, SetReadonly
Dustin Demuth <dustin@intevation.de>
parents:
694
diff
changeset
|
253 element = this.down('component[name=' + key + ']'); |
2ad36c8db968
Added ClearMessages, SetWarnigs, SetReadonly
Dustin Demuth <dustin@intevation.de>
parents:
694
diff
changeset
|
254 if (!element) { |
2ad36c8db968
Added ClearMessages, SetWarnigs, SetReadonly
Dustin Demuth <dustin@intevation.de>
parents:
694
diff
changeset
|
255 continue; |
2ad36c8db968
Added ClearMessages, SetWarnigs, SetReadonly
Dustin Demuth <dustin@intevation.de>
parents:
694
diff
changeset
|
256 } |
2ad36c8db968
Added ClearMessages, SetWarnigs, SetReadonly
Dustin Demuth <dustin@intevation.de>
parents:
694
diff
changeset
|
257 content = warnings[key]; |
2ad36c8db968
Added ClearMessages, SetWarnigs, SetReadonly
Dustin Demuth <dustin@intevation.de>
parents:
694
diff
changeset
|
258 var warnText = ''; |
2ad36c8db968
Added ClearMessages, SetWarnigs, SetReadonly
Dustin Demuth <dustin@intevation.de>
parents:
694
diff
changeset
|
259 for (var i = 0; i < content.length; i++) { |
2ad36c8db968
Added ClearMessages, SetWarnigs, SetReadonly
Dustin Demuth <dustin@intevation.de>
parents:
694
diff
changeset
|
260 warnText += i18n.getMsg(content[i].toString()) + '\n'; |
2ad36c8db968
Added ClearMessages, SetWarnigs, SetReadonly
Dustin Demuth <dustin@intevation.de>
parents:
694
diff
changeset
|
261 } |
2ad36c8db968
Added ClearMessages, SetWarnigs, SetReadonly
Dustin Demuth <dustin@intevation.de>
parents:
694
diff
changeset
|
262 element.showWarnings(warnText); |
2ad36c8db968
Added ClearMessages, SetWarnigs, SetReadonly
Dustin Demuth <dustin@intevation.de>
parents:
694
diff
changeset
|
263 } |
2ad36c8db968
Added ClearMessages, SetWarnigs, SetReadonly
Dustin Demuth <dustin@intevation.de>
parents:
694
diff
changeset
|
264 } |
2ad36c8db968
Added ClearMessages, SetWarnigs, SetReadonly
Dustin Demuth <dustin@intevation.de>
parents:
694
diff
changeset
|
265 if (errors) { |
2ad36c8db968
Added ClearMessages, SetWarnigs, SetReadonly
Dustin Demuth <dustin@intevation.de>
parents:
694
diff
changeset
|
266 for (key in errors) { |
2ad36c8db968
Added ClearMessages, SetWarnigs, SetReadonly
Dustin Demuth <dustin@intevation.de>
parents:
694
diff
changeset
|
267 element = this.down('component[name=' + key + ']'); |
2ad36c8db968
Added ClearMessages, SetWarnigs, SetReadonly
Dustin Demuth <dustin@intevation.de>
parents:
694
diff
changeset
|
268 if (!element) { |
2ad36c8db968
Added ClearMessages, SetWarnigs, SetReadonly
Dustin Demuth <dustin@intevation.de>
parents:
694
diff
changeset
|
269 continue; |
2ad36c8db968
Added ClearMessages, SetWarnigs, SetReadonly
Dustin Demuth <dustin@intevation.de>
parents:
694
diff
changeset
|
270 } |
2ad36c8db968
Added ClearMessages, SetWarnigs, SetReadonly
Dustin Demuth <dustin@intevation.de>
parents:
694
diff
changeset
|
271 content = errors[key]; |
2ad36c8db968
Added ClearMessages, SetWarnigs, SetReadonly
Dustin Demuth <dustin@intevation.de>
parents:
694
diff
changeset
|
272 var errorText = ''; |
2ad36c8db968
Added ClearMessages, SetWarnigs, SetReadonly
Dustin Demuth <dustin@intevation.de>
parents:
694
diff
changeset
|
273 for (var i = 0; i < content.length; i++) { |
2ad36c8db968
Added ClearMessages, SetWarnigs, SetReadonly
Dustin Demuth <dustin@intevation.de>
parents:
694
diff
changeset
|
274 errorText += i18n.getMsg(content[i].toString()) + '\n'; |
2ad36c8db968
Added ClearMessages, SetWarnigs, SetReadonly
Dustin Demuth <dustin@intevation.de>
parents:
694
diff
changeset
|
275 } |
2ad36c8db968
Added ClearMessages, SetWarnigs, SetReadonly
Dustin Demuth <dustin@intevation.de>
parents:
694
diff
changeset
|
276 element.showErrors(errorText); |
2ad36c8db968
Added ClearMessages, SetWarnigs, SetReadonly
Dustin Demuth <dustin@intevation.de>
parents:
694
diff
changeset
|
277 } |
2ad36c8db968
Added ClearMessages, SetWarnigs, SetReadonly
Dustin Demuth <dustin@intevation.de>
parents:
694
diff
changeset
|
278 } |
581
424802824648
Added a form for Messungen (unfinished)
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
279 }, |
424802824648
Added a form for Messungen (unfinished)
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
280 |
424802824648
Added a form for Messungen (unfinished)
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
281 clearMessages: function() { |
708
2ad36c8db968
Added ClearMessages, SetWarnigs, SetReadonly
Dustin Demuth <dustin@intevation.de>
parents:
694
diff
changeset
|
282 this.down('tfield[name=nebenprobenNr]').clearWarningOrError(); |
2ad36c8db968
Added ClearMessages, SetWarnigs, SetReadonly
Dustin Demuth <dustin@intevation.de>
parents:
694
diff
changeset
|
283 //this.down('messmethode[name=mmtId]').clearWarningOrError(); |
2ad36c8db968
Added ClearMessages, SetWarnigs, SetReadonly
Dustin Demuth <dustin@intevation.de>
parents:
694
diff
changeset
|
284 this.down('datetime[name=messzeitpunkt]').clearWarningOrError(); |
2ad36c8db968
Added ClearMessages, SetWarnigs, SetReadonly
Dustin Demuth <dustin@intevation.de>
parents:
694
diff
changeset
|
285 //this.down('numberfield[name=messdauer]').clearWarningOrError(); |
2ad36c8db968
Added ClearMessages, SetWarnigs, SetReadonly
Dustin Demuth <dustin@intevation.de>
parents:
694
diff
changeset
|
286 this.down('chkbox[name=fertig]').clearWarningOrError(); |
2ad36c8db968
Added ClearMessages, SetWarnigs, SetReadonly
Dustin Demuth <dustin@intevation.de>
parents:
694
diff
changeset
|
287 this.down('chkbox[name=geplant]').clearWarningOrError(); |
581
424802824648
Added a form for Messungen (unfinished)
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
288 }, |
424802824648
Added a form for Messungen (unfinished)
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
289 |
694 | 290 setReadOnly: function(value) { |
708
2ad36c8db968
Added ClearMessages, SetWarnigs, SetReadonly
Dustin Demuth <dustin@intevation.de>
parents:
694
diff
changeset
|
291 this.down('tfield[name=nebenprobenNr]').setReadOnly(value); |
710
f204f30b824a
Handle readonly mode and refresh operations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
708
diff
changeset
|
292 this.down('messmethode[name=mmtId]').setReadOnly(value); |
694 | 293 this.down('datetime[name=messzeitpunkt]').setReadOnly(value); |
294 this.down('numberfield[name=messdauer]').setReadOnly(value); | |
715
605bc34b45a0
Disable the Fertig-Flag Checkbox in a Messung when the User is not the owner. Do not enable Form-Children when readonly is set to true. Parse login-response in app.js
Dustin Demuth <dustin@intevation.de>
parents:
710
diff
changeset
|
295 if (!this.getForm().getRecord().get('owner')) { |
605bc34b45a0
Disable the Fertig-Flag Checkbox in a Messung when the User is not the owner. Do not enable Form-Children when readonly is set to true. Parse login-response in app.js
Dustin Demuth <dustin@intevation.de>
parents:
710
diff
changeset
|
296 //Only set this Field to Readonly when the User is NOT the Owner of the Record. |
605bc34b45a0
Disable the Fertig-Flag Checkbox in a Messung when the User is not the owner. Do not enable Form-Children when readonly is set to true. Parse login-response in app.js
Dustin Demuth <dustin@intevation.de>
parents:
710
diff
changeset
|
297 this.down('chkbox[name=fertig]').setReadOnly(value); |
605bc34b45a0
Disable the Fertig-Flag Checkbox in a Messung when the User is not the owner. Do not enable Form-Children when readonly is set to true. Parse login-response in app.js
Dustin Demuth <dustin@intevation.de>
parents:
710
diff
changeset
|
298 } |
581
424802824648
Added a form for Messungen (unfinished)
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
299 } |
424802824648
Added a form for Messungen (unfinished)
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
300 }); |