Mercurial > lada > lada-client
annotate app/view/form/Ortszuordnung.js @ 1144:5ceb0381ae73
Set a regex and required for ortszuordnungstyp field.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Fri, 27 May 2016 14:51:12 +0200 |
parents | f1d21e6a7449 |
children | 1cf5280bbc45 |
rev | line source |
---|---|
1013
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
2 * Software engineering by Intevation GmbH |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
3 * |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
4 * This file is Free Software under the GNU GPL (v>=3) |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
6 * the documentation coming with IMIS-Labordaten-Application for details. |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
7 */ |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
8 |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
9 /** |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
10 * Form to edit the Ortszuordnung of a Probe |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
11 */ |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
12 Ext.define('Lada.view.form.Ortszuordnung', { |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
13 extend: 'Ext.form.Panel', |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
14 alias: 'widget.ortszuordnungform', |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
15 |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
16 model: 'Lada.model.Ortszuordnung', |
1021
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
17 |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
18 requires: [ |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
19 'Lada.view.widget.Verwaltungseinheit', |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
20 'Lada.view.widget.Staat' |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
21 ], |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
22 |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
23 layout: 'fit', |
1013
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
24 margin: 5, |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
25 border: 0, |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
26 |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
27 record: null, |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
28 |
1022
6d33a84979e4
More work on the Ortszuordnung grid. Saving does not work yet
Dustin Demuth <dustin@intevation.de>
parents:
1021
diff
changeset
|
29 trackResetOnLoad: true, |
1013
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
30 |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
31 initComponent: function() { |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
32 var i18n = Lada.getApplication().bundle; |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
33 this.items = [{ |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
34 xtype: 'fieldset', |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
35 title: i18n.getMsg('ortszuordnung.form.fset.title'), |
1021
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
36 layout: 'fit', |
1013
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
37 items: [{ |
1021
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
38 layout: 'hbox', |
1013
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
39 border: 0, |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
40 margin: '0, 0, 10, 0', |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
41 dockedItems: [{ |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
42 xtype: 'toolbar', |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
43 dock: 'bottom', |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
44 border: '0, 1, 1, 1', |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
45 style: { |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
46 borderBottom: '1px solid #b5b8c8 !important', |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
47 borderLeft: '1px solid #b5b8c8 !important', |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
48 borderRight: '1px solid #b5b8c8 !important' |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
49 }, |
1021
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
50 items: [{ |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
51 text: i18n.getMsg('ortszuordnung.form.setOrt'), |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
52 qtip: i18n.getMsg('ortszuordnung.form.setOrt.qtip'), |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
53 icon: 'resources/img/dialog-ok-apply.png', |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
54 action: 'setOrt', |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
55 enableToggle: true, |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
56 disabled: true |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
57 }, '->', { |
1013
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
58 text: i18n.getMsg('save'), |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
59 qtip: i18n.getMsg('save.qtip'), |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
60 icon: 'resources/img/dialog-ok-apply.png', |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
61 action: 'save', |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
62 disabled: true |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
63 }, { |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
64 text: i18n.getMsg('discard'), |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
65 qtip: i18n.getMsg('discard.qtip'), |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
66 icon: 'resources/img/dialog-cancel.png', |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
67 action: 'discard', |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
68 disabled: true |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
69 }] |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
70 }], |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
71 items: [{ |
1021
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
72 layout: 'vbox', |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
73 border: 0, |
1049
1bd4c0709bd6
Working version of selectable 'ort' in map and grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1022
diff
changeset
|
74 margin: '0, 10, 0, 0', |
1013
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
75 items: [{ |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
76 xtype: 'tfield', |
1049
1bd4c0709bd6
Working version of selectable 'ort' in map and grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1022
diff
changeset
|
77 labelWidth: 125, |
1013
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
78 maxLength: 100, |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
79 name: 'ortszusatztext', |
1049
1bd4c0709bd6
Working version of selectable 'ort' in map and grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1022
diff
changeset
|
80 fieldLabel: i18n.getMsg('ortszuordnung.form.field.ortszusatztext') |
1013
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
81 }, { |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
82 xtype: 'tfield', |
1049
1bd4c0709bd6
Working version of selectable 'ort' in map and grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1022
diff
changeset
|
83 labelWidth: 125, |
1144
5ceb0381ae73
Set a regex and required for ortszuordnungstyp field.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1134
diff
changeset
|
84 maxLength: 1, |
5ceb0381ae73
Set a regex and required for ortszuordnungstyp field.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1134
diff
changeset
|
85 allowBlank: false, |
5ceb0381ae73
Set a regex and required for ortszuordnungstyp field.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1134
diff
changeset
|
86 regex: /[U,E,Z,A]/, |
1013
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
87 name: 'ortszuordnungTyp', |
1049
1bd4c0709bd6
Working version of selectable 'ort' in map and grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1022
diff
changeset
|
88 fieldLabel: i18n.getMsg('ortszuordnung.form.field.ortszuordnungtyp') |
1021
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
89 }, { |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
90 xtype: 'textfield', |
1022
6d33a84979e4
More work on the Ortszuordnung grid. Saving does not work yet
Dustin Demuth <dustin@intevation.de>
parents:
1021
diff
changeset
|
91 submitValue: true, |
1021
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
92 readOnly: true, |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
93 hidden: true, |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
94 name: 'ortId' |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
95 }] |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
96 }, { |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
97 layout: 'vbox', |
1049
1bd4c0709bd6
Working version of selectable 'ort' in map and grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1022
diff
changeset
|
98 flex: 1, |
1bd4c0709bd6
Working version of selectable 'ort' in map and grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1022
diff
changeset
|
99 margin: '0, 10, 0, 0', |
1021
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
100 border: 0, |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
101 items: [{ |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
102 xtype: 'displayfield', |
1049
1bd4c0709bd6
Working version of selectable 'ort' in map and grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1022
diff
changeset
|
103 labelWidth: 125, |
1bd4c0709bd6
Working version of selectable 'ort' in map and grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1022
diff
changeset
|
104 fieldLabel: i18n.getMsg('orte.gemeinde'), |
1021
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
105 name: 'gemeinde' |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
106 }, { |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
107 xtype: 'displayfield', |
1049
1bd4c0709bd6
Working version of selectable 'ort' in map and grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1022
diff
changeset
|
108 labelWidth: 125, |
1021
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
109 fieldLabel: i18n.getMsg('staat'), |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
110 name: 'staat' |
1013
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
111 }] |
1049
1bd4c0709bd6
Working version of selectable 'ort' in map and grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1022
diff
changeset
|
112 }, { |
1bd4c0709bd6
Working version of selectable 'ort' in map and grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1022
diff
changeset
|
113 layout: 'vbox', |
1bd4c0709bd6
Working version of selectable 'ort' in map and grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1022
diff
changeset
|
114 flex: 1, |
1bd4c0709bd6
Working version of selectable 'ort' in map and grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1022
diff
changeset
|
115 margin: '0, 10, 0, 0', |
1bd4c0709bd6
Working version of selectable 'ort' in map and grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1022
diff
changeset
|
116 border: 0, |
1bd4c0709bd6
Working version of selectable 'ort' in map and grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1022
diff
changeset
|
117 items: [{ |
1bd4c0709bd6
Working version of selectable 'ort' in map and grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1022
diff
changeset
|
118 xtype: 'displayfield', |
1bd4c0709bd6
Working version of selectable 'ort' in map and grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1022
diff
changeset
|
119 labelWidth: 125, |
1bd4c0709bd6
Working version of selectable 'ort' in map and grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1022
diff
changeset
|
120 fieldLabel: i18n.getMsg('orte.lon'), |
1bd4c0709bd6
Working version of selectable 'ort' in map and grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1022
diff
changeset
|
121 name: 'lon' |
1bd4c0709bd6
Working version of selectable 'ort' in map and grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1022
diff
changeset
|
122 }, { |
1bd4c0709bd6
Working version of selectable 'ort' in map and grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1022
diff
changeset
|
123 xtype: 'displayfield', |
1bd4c0709bd6
Working version of selectable 'ort' in map and grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1022
diff
changeset
|
124 labelWidth: 125, |
1bd4c0709bd6
Working version of selectable 'ort' in map and grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1022
diff
changeset
|
125 fieldLabel: i18n.getMsg('orte.lat'), |
1bd4c0709bd6
Working version of selectable 'ort' in map and grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1022
diff
changeset
|
126 name: 'lat' |
1bd4c0709bd6
Working version of selectable 'ort' in map and grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1022
diff
changeset
|
127 }] |
1013
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
128 }] |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
129 }] |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
130 }]; |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
131 this.callParent(arguments); |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
132 }, |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
133 |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
134 setRecord: function(record) { |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
135 this.getForm().loadRecord(record); |
1021
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
136 |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
137 if (! record.get('readonly')) { |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
138 this.down('[action=setOrt]').enable(); |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
139 this.setReadOnly(false); |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
140 } |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
141 else { |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
142 this.setReadOnly(true); |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
143 } |
1022
6d33a84979e4
More work on the Ortszuordnung grid. Saving does not work yet
Dustin Demuth <dustin@intevation.de>
parents:
1021
diff
changeset
|
144 var ortId = this.getRecord().get('ortId'); |
6d33a84979e4
More work on the Ortszuordnung grid. Saving does not work yet
Dustin Demuth <dustin@intevation.de>
parents:
1021
diff
changeset
|
145 this.refreshOrt(ortId); |
1021
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
146 }, |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
147 |
1022
6d33a84979e4
More work on the Ortszuordnung grid. Saving does not work yet
Dustin Demuth <dustin@intevation.de>
parents:
1021
diff
changeset
|
148 refreshOrt: function(ortId) { |
1021
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
149 var orteStore = Ext.StoreManager.get('orte'); |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
150 var ort = orteStore.getById(ortId); |
1134
f1d21e6a7449
Fixed adding new ortszuortnung for probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1051
diff
changeset
|
151 if (!ort) { |
f1d21e6a7449
Fixed adding new ortszuortnung for probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1051
diff
changeset
|
152 return; |
f1d21e6a7449
Fixed adding new ortszuortnung for probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1051
diff
changeset
|
153 } |
1049
1bd4c0709bd6
Working version of selectable 'ort' in map and grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1022
diff
changeset
|
154 var verwStore = Ext.StoreManager.get('verwaltungseinheiten'); |
1021
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
155 var verw = verwStore.getById(ort.get('gemId')); |
1049
1bd4c0709bd6
Working version of selectable 'ort' in map and grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1022
diff
changeset
|
156 var staatStore = Ext.StoreManager.get('staaten'); |
1021
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
157 var staat = staatStore.getById(ort.get('staatId')); |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
158 |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
159 this.getForm().setValues({ |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
160 gemeinde: verw.get('bezeichnung'), |
1049
1bd4c0709bd6
Working version of selectable 'ort' in map and grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1022
diff
changeset
|
161 staat: staat.get('staatIso'), |
1bd4c0709bd6
Working version of selectable 'ort' in map and grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1022
diff
changeset
|
162 lon: ort.get('longitude'), |
1bd4c0709bd6
Working version of selectable 'ort' in map and grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1022
diff
changeset
|
163 lat: ort.get('latitude') |
1021
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
164 }); |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
165 }, |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
166 |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
167 /** |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
168 * setOrt can be called from a CallbackFunction, ie select from a grid. |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
169 * it will set the ortId of this record |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
170 */ |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
171 setOrt: function(row, selRecord, index, opts) { |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
172 var newOrtId = selRecord.get('id'); |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
173 var r = this.getRecord(); |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
174 if (newOrtId) { |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
175 if (newOrtId != r.get('ortId')) { |
1051
981339d774b8
merged stammdatengrids to default.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1049
diff
changeset
|
176 r.set('ortId', newOrtId); |
981339d774b8
merged stammdatengrids to default.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1049
diff
changeset
|
177 this.getForm().setValues({ortId: newOrtId}); |
1022
6d33a84979e4
More work on the Ortszuordnung grid. Saving does not work yet
Dustin Demuth <dustin@intevation.de>
parents:
1021
diff
changeset
|
178 this.refreshOrt(newOrtId); |
1021
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
179 //set dirty... |
1022
6d33a84979e4
More work on the Ortszuordnung grid. Saving does not work yet
Dustin Demuth <dustin@intevation.de>
parents:
1021
diff
changeset
|
180 this.fireEvent('dirtychange', this.getForm(), true); |
1021
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
181 } |
1df6b6210b42
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
Dustin Demuth <dustin@intevation.de>
parents:
1013
diff
changeset
|
182 } |
1013
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
183 }, |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
184 |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
185 setMessages: function(errors, warnings) { |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
186 var key; |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
187 var element; |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
188 var content; |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
189 var i18n = Lada.getApplication().bundle; |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
190 if (warnings) { |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
191 for (key in warnings) { |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
192 element = this.down('component[name=' + key + ']'); |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
193 if (!element) { |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
194 continue; |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
195 } |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
196 content = warnings[key]; |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
197 var warnText = ''; |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
198 for (var i = 0; i < content.length; i++) { |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
199 warnText += i18n.getMsg(content[i].toString()) + '\n'; |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
200 } |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
201 element.showWarnings(warnText); |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
202 } |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
203 } |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
204 if (errors) { |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
205 for (key in errors) { |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
206 element = this.down('component[name=' + key + ']'); |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
207 if (!element) { |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
208 continue; |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
209 } |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
210 content = errors[key]; |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
211 var errorText = ''; |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
212 for (var i = 0; i < content.length; i++) { |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
213 errorText += i18n.getMsg(content[i].toString()) + '\n'; |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
214 } |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
215 element.showErrors(errorText); |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
216 } |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
217 } |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
218 }, |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
219 |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
220 clearMessages: function() { |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
221 this.down('tfield[name=ortszusatztext]').clearWarningOrError(); |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
222 this.down('tfield[name=ortszuordnungTyp]').clearWarningOrError(); |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
223 }, |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
224 |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
225 setReadOnly: function(value) { |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
226 this.down('tfield[name=ortszusatztext]').setReadOnly(value); |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
227 this.down('tfield[name=ortszuordnungTyp]').setReadOnly(value); |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
228 } |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
229 }); |
75ce503ab296
Added a Ortszuordnungwindow and Form
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
230 |