Mercurial > lada > lada-client
annotate app/view/form/Ortserstellung.js @ 1288:08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
author | Maximilian Krambach <mkrambach@intevation.de> |
---|---|
date | Fri, 27 Jan 2017 13:25:14 +0100 |
parents | faecbb446a04 |
children | bfdc00c24baf |
rev | line source |
---|---|
1279
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
2 * Software engineering by Intevation GmbH |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
3 * |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
4 * This file is Free Software under the GNU GPL (v>=3) |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
6 * the documentation coming with IMIS-Labordaten-Application for details. |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
7 */ |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
8 |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
9 /** |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
10 * Form to create a new Messpunkt |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
11 */ |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
12 Ext.define('Lada.view.form.Ortserstellung', { |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
13 extend: 'Ext.form.Panel', |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
14 alias: 'widget.ortserstellungsform', |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
15 requires: [ |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
16 'Lada.view.widget.Verwaltungseinheit', |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
17 'Lada.view.widget.Staat' |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
18 ], |
1284
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
19 model: null, |
1279
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
20 |
1284
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
21 record: null, |
1279
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
22 |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
23 initComponent: function() { |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
24 var i18n = Lada.getApplication().bundle; |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
25 var me = this; |
1284
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
26 this.items = [{ |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
27 xtype: 'netzbetreiber', |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
28 editable: false, |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
29 readOnly: true, |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
30 submitValue: true, |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
31 fieldLabel: i18n.getMsg('netzbetreiberId'), |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
32 margin : '0, 5, 5, 5', |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
33 labelWidth: 80, |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
34 width: 150, |
1288
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1284
diff
changeset
|
35 value: Lada.netzbetreiber[0] |
1279
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
36 }, { |
1284
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
37 xtype: 'checkbox', |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
38 name: 'aktiv', |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
39 fieldLabel: 'aktiv:' |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
40 }, { |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
41 xtype: 'displayfield', |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
42 align: 'right', |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
43 value: 'D', |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
44 labelWidth: 125, |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
45 maxLength: 1, |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
46 name: 'messpunktart', |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
47 fieldLabel: 'Art des Messpunktes:' |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
48 },{ |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
49 xtype: 'staat', |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
50 labelWidth: 125, |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
51 fieldLabel: i18n.getMsg('staat'), |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
52 name: 'staatId', |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
53 listeners: { |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
54 change: { |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
55 fn: function() { me.checkCommitEnabled() } |
1279
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
56 } |
1284
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
57 } |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
58 }, { |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
59 xtype: 'verwaltungseinheit', |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
60 labelWidth: 125, |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
61 fieldLabel: i18n.getMsg('orte.gemeinde'), |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
62 name: 'gemId', |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
63 listeners: { |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
64 change: { |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
65 fn: function() { me.checkCommitEnabled() } |
1279
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
66 } |
1284
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
67 } |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
68 }, { |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
69 xtype: 'numfield', |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
70 labelWidth: 125, |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
71 fieldLabel: i18n.getMsg('orte.kda'), |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
72 allowDecimals: false, |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
73 maxLength: 1, |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
74 name: 'kdaId', |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
75 listeners: { |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
76 change: { |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
77 fn: function() { me.checkCommitEnabled() } |
1279
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
78 } |
1284
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
79 } |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
80 }, { |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
81 xtype: 'numfield', |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
82 labelWidth: 125, |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
83 fieldLabel: i18n.getMsg('orte.koordx'), |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
84 name: 'koordXExtern', |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
85 allowDecimals: true, |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
86 decimalPrecision: 5, |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
87 maxLength: 10, |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
88 listeners: { |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
89 change: { |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
90 fn: function() { me.checkCommitEnabled() } |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
91 } |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
92 } |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
93 }, { |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
94 xtype: 'numfield', |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
95 labelWidth: 125, |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
96 fieldLabel: i18n.getMsg('orte.koordy'), |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
97 name: 'koordYExtern', |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
98 allowDecimals: true, |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
99 decimalPrecision: 5, |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
100 maxLength: 10, |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
101 listeners: { |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
102 change: { |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
103 fn: function() { me.checkCommitEnabled() } |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
104 } |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
105 } |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
106 }, { |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
107 xtype: 'numfield', |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
108 labelWidth: 125, |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
109 fieldLabel: 'Höhe:', |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
110 name: 'hoeheLand', |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
111 maxLength: 10, |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
112 allowDecimals: true |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
113 }, { |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
114 xtype: 'tfield', |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
115 labelWidth: 125, |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
116 maxLength: 100, |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
117 name: 'kurztext', |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
118 fieldLabel: i18n.getMsg('orte.kurztext'), |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
119 },{ |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
120 xtype: 'tfield', |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
121 labelWidth: 125, |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
122 fieldLabel: i18n.getMsg('orte.langtext'), |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
123 name: 'langtext' |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
124 },{ |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
125 xtype: 'tfield', |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
126 labelWidth: 125, |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
127 fieldLabel: 'Berichtstext:', |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
128 name: 'berichtstext' |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
129 }]; |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
130 this.dockedItems = [{ |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
131 xtype: 'toolbar', |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
132 dock: 'bottom', |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
133 border: '0, 1, 1, 1', |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
134 style: { |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
135 borderBottom: '1px solid #b5b8c8 !important', |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
136 borderLeft: '1px solid #b5b8c8 !important', |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
137 borderRight: '1px solid #b5b8c8 !important' |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
138 }, |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
139 items: ['->', { |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
140 text: i18n.getMsg('save'), |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
141 action: 'save', |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
142 handler: me.saveOrt, |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
143 disabled: true |
1279
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
144 }, { |
1284
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
145 text: i18n.getMsg('close'), |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
146 action: 'close', |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
147 handler: function() { |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
148 me.close(); |
1279
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
149 } |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
150 }] |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
151 }]; |
1284
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
152 |
1279
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
153 //TODO: |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
154 // 'Anlage:'? |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
155 // zone |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
156 // sektor |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
157 // zustaendigkeit |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
158 // Messregime (mpArt) |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
159 // 'Prog.-Punkt:', ? |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
160 // nutsCode |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
161 // Ortszusatz-ID (ozId) |
1284
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
162 this.callParent(arguments); |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
163 this.getForm().loadRecord(this.record); |
1279
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
164 }, |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
165 |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
166 /** |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
167 * checks Messpunktart and if the Messpunkt can be committed. |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
168 * Disables the save button if false |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
169 */ |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
170 // TODO messpunktart is not yet finally defined |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
171 checkCommitEnabled: function() { |
1284
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
172 var savebutton = this.down('toolbar').down('button[action=save]'); |
1279
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
173 var form = this.getForm(); |
1284
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
174 if (this.getForm().findField('kdaId').getValue() || |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
175 this.getForm().findField('koordYExtern').getValue() || |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
176 this.getForm().findField('koordXExtern').getValue()) { |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
177 if (this.checkCoordinates()) { |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
178 form.findField('messpunktart').setValue('D'); |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
179 savebutton.setDisabled(false); |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
180 } else { |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
181 savebutton.setDisabled(true); |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
182 } |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
183 } else if (form.findField('gemId').getValue()) { |
1279
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
184 form.findField('messpunktart').setValue('V'); |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
185 savebutton.setDisabled(false); |
1284
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
186 } else if (form.findField('staatId').getValue()) { |
1279
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
187 form.findField('messpunktart').setValue('S'); |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
188 savebutton.setDisabled(false); |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
189 } else { |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
190 form.findField('messpunktart').setValue('D'); |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
191 savebutton.setDisabled(true); |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
192 } |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
193 }, |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
194 |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
195 /** |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
196 * Validates the coordinate fields kdaId, koordXExtern, koordYExtern |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
197 */ |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
198 checkCoordinates: function() { |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
199 var x = this.getForm().findField('koordXExtern').getValue(); |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
200 var y = this.getForm().findField('koordYExtern').getValue(); |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
201 var kda = this.getForm().findField('kdaId').getValue(); |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
202 if (x && y && kda) { |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
203 if (kda === 4){ |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
204 if (x > -180 && x < 180 |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
205 && y > -90 && y < 90) { |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
206 return true; |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
207 } else { |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
208 // TODO: WGS84 (degrees- decimal), coordinates invalid |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
209 return false; |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
210 } |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
211 } else if (kda === 5){ |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
212 if (x >= 1000000 && x < 61000000 && |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
213 y > -10000000 && y < 10000000) { |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
214 return true; |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
215 } else { |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
216 // TODO: UTM, coordinates invalid |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
217 return false; |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
218 } |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
219 } else { |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
220 // TODO KDA not supported |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
221 return false; |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
222 } |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
223 } else { |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
224 // TODO: not all fields filled in |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
225 return false; |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
226 } |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
227 }, |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
228 |
1284
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
229 saveOrt: function() { |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
230 var this_panel = this.up('panel'); |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
231 var form = this_panel.getForm(); |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
232 var data = form.getFieldValues(true); |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
233 for (var key in data) { |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
234 form.getRecord().set(key, data[key]); |
1279
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
235 } |
1284
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
236 this_panel.record.set('letzteAenderung', 0); |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
237 this_panel.record.set('id', null); |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
238 this_panel.record.set('ortId', null); |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
239 this_panel.record.set('netzbetreiberId', Lada.netzbetreiber[0]); |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
240 this_panel.record.save({ |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
241 success: function(record, response) { |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
242 var newOrtId; |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
243 Ext.Msg.show({ |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
244 title: Lada.getApplication().bundle.getMsg('success'), |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
245 autoScroll: true, |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
246 msg: 'Ort erfolgreich angelegt!', |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
247 buttons: Ext.Msg.OK |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
248 }); |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
249 var ozw = this_panel.up().parentWindow; |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
250 ozw.ortstore.load({ |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
251 callback: function(records, operation, success) { |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
252 ozw.down('map').addLocations(ozw.ortstore); |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
253 ozw.down('ortstammdatengrid').setStore(ozw.ortstore); |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
254 var id = Ext.decode(response.response.responseText).data.id; |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
255 var record = ozw.down('ortstammdatengrid').store.getById(id); |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
256 var selectionmodel = ozw.down('ortstammdatengrid').getSelectionModel(); |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
257 console.log(record); |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
258 selectionmodel.select(record); |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
259 this_panel.close(); |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
260 }, |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
261 scope: this |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
262 }); |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
263 }, |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
264 failure: function(record, response) { |
1288
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1284
diff
changeset
|
265 // TODO check |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1284
diff
changeset
|
266 var json = Ext.decode(response.response.responseText); |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1284
diff
changeset
|
267 if (json) { |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1284
diff
changeset
|
268 if(json.errors.totalCount > 0 || json.warnings.totalCount > 0){ |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1284
diff
changeset
|
269 formPanel.setMessages(json.errors, json.warnings); |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1284
diff
changeset
|
270 } |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1284
diff
changeset
|
271 if(json.message){ |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1284
diff
changeset
|
272 Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title') |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1284
diff
changeset
|
273 +' #'+json.message, |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1284
diff
changeset
|
274 Lada.getApplication().bundle.getMsg(json.message)); |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1284
diff
changeset
|
275 } else { |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1284
diff
changeset
|
276 Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title'), |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1284
diff
changeset
|
277 Lada.getApplication().bundle.getMsg('err.msg.generic.body')); |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1284
diff
changeset
|
278 } |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1284
diff
changeset
|
279 } else { |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1284
diff
changeset
|
280 Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title'), |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1284
diff
changeset
|
281 Lada.getApplication().bundle.getMsg('err.msg.response.body')); |
08085b7d1d0b
Ortszuordnung: Search, new orte, display and validity check
Maximilian Krambach <mkrambach@intevation.de>
parents:
1284
diff
changeset
|
282 } |
1284
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
283 } |
faecbb446a04
Ortserstellung: new Messpunkt from map, clone or form
Maximilian Krambach <mkrambach@intevation.de>
parents:
1279
diff
changeset
|
284 }); |
1279
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
285 } |
291df0037835
Ortszuordnung window: create, change and display (wip)
Maximilian Krambach <mkrambach@intevation.de>
parents:
diff
changeset
|
286 }); |