Mercurial > lada > lada-client
annotate app/view/orte/CreateOrt.js @ 488:f7446ebfe5d0
Added and updated models.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Fri, 31 Oct 2014 21:10:35 +0100 |
parents | debfcc7713e3 |
children | 850ccfe5f3c4 |
rev | line source |
---|---|
472
debfcc7713e3
Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
450
diff
changeset
|
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz |
debfcc7713e3
Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
450
diff
changeset
|
2 * Software engineering by Intevation GmbH |
debfcc7713e3
Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
450
diff
changeset
|
3 * |
debfcc7713e3
Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
450
diff
changeset
|
4 * This file is Free Software under the GNU GPL (v>=3) |
debfcc7713e3
Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
450
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out |
debfcc7713e3
Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
450
diff
changeset
|
6 * the documentation coming with IMIS-Labordaten-Application for details. |
debfcc7713e3
Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
450
diff
changeset
|
7 */ |
debfcc7713e3
Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
450
diff
changeset
|
8 |
446
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
9 /** |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
10 * |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
11 */ |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
12 Ext.define('Lada.view.orte.CreateOrt', { |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
13 extend: 'Ext.window.Window', |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
14 alias: 'widget.createortdetail', |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
15 title: 'Neuer Ort', |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
16 |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
17 /** |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
18 * @private |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
19 * Initialize the view. |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
20 */ |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
21 initComponent: function() { |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
22 var me = this; |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
23 |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
24 var form = Ext.create('Ext.form.Panel', { |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
25 items: [{ |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
26 xtype: 'textfield', |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
27 maxLength: 100, |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
28 name: 'ort_beschreibung', |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
29 fieldLabel: 'Beschreibung' |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
30 }, |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
31 { |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
32 xtype: 'staat', |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
33 name: 'ort_staatId', |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
34 fieldLabel: 'Staat' |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
35 }, |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
36 { |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
37 xtype: 'verwaltungseinheiten', |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
38 name: 'ort_gemId', |
450
e228fecd1577
Set lon/lat coordinates when selecting a verwaltungseinheit.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
446
diff
changeset
|
39 fieldLabel: 'Gemeinde', |
e228fecd1577
Set lon/lat coordinates when selecting a verwaltungseinheit.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
446
diff
changeset
|
40 listeners: { |
e228fecd1577
Set lon/lat coordinates when selecting a verwaltungseinheit.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
446
diff
changeset
|
41 'select': { |
e228fecd1577
Set lon/lat coordinates when selecting a verwaltungseinheit.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
446
diff
changeset
|
42 scope: me, |
e228fecd1577
Set lon/lat coordinates when selecting a verwaltungseinheit.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
446
diff
changeset
|
43 fn: function(field, newValue, oldValue) { |
e228fecd1577
Set lon/lat coordinates when selecting a verwaltungseinheit.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
446
diff
changeset
|
44 var lon = field.up('window').down( |
e228fecd1577
Set lon/lat coordinates when selecting a verwaltungseinheit.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
446
diff
changeset
|
45 'numberfield[name=ort_longitude]'); |
e228fecd1577
Set lon/lat coordinates when selecting a verwaltungseinheit.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
446
diff
changeset
|
46 var lat = field.up('window').down( |
e228fecd1577
Set lon/lat coordinates when selecting a verwaltungseinheit.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
446
diff
changeset
|
47 'numberfield[name=ort_latitude]'); |
e228fecd1577
Set lon/lat coordinates when selecting a verwaltungseinheit.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
446
diff
changeset
|
48 lon.setValue(newValue[0].data.longitude); |
e228fecd1577
Set lon/lat coordinates when selecting a verwaltungseinheit.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
446
diff
changeset
|
49 lat.setValue(newValue[0].data.latitude); |
e228fecd1577
Set lon/lat coordinates when selecting a verwaltungseinheit.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
446
diff
changeset
|
50 } |
e228fecd1577
Set lon/lat coordinates when selecting a verwaltungseinheit.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
446
diff
changeset
|
51 } |
e228fecd1577
Set lon/lat coordinates when selecting a verwaltungseinheit.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
446
diff
changeset
|
52 } |
446
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
53 }, |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
54 { |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
55 xtype: 'numberfield', |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
56 name: 'ort_latitude', |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
57 fieldLabel: 'Lat' |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
58 }, |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
59 { |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
60 xtype: 'numberfield', |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
61 name: 'ort_longitude', |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
62 fieldLabel: 'Lon' |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
63 }, |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
64 { |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
65 xtype: 'numberfield', |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
66 name: 'ort_hoeheLand', |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
67 fieldLabel: 'Höhe' |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
68 }] |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
69 }); |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
70 |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
71 me.items = [form]; |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
72 this.buttons = [ |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
73 { |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
74 text: 'Speichern', |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
75 scope: form, |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
76 action: 'save' |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
77 }, |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
78 { |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
79 text: 'Abbrechen', |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
80 scope: this, |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
81 handler: this.close |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
82 } |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
83 ]; |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
84 this.callParent(arguments); |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
85 } |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
86 }); |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
87 |