Mercurial > lada > lada-client
annotate app/view/orte/CreateOrt.js @ 500:ad7f574b382a
Fixed some js related issues (unused vars, arrays, etc.) and code style.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Thu, 06 Nov 2014 11:20:47 +0100 |
parents | c1b77fb96b01 |
children |
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 |
497
7c0653e8d9f7
Fixed some js related issues (unused vars, arrays, etc.) and code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
491
diff
changeset
|
6 * the documentation coming with IMIS-Labordaten-Application for details. |
472
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', |
497
7c0653e8d9f7
Fixed some js related issues (unused vars, arrays, etc.) and code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
491
diff
changeset
|
15 |
498
c1b77fb96b01
Have consistent requires in classes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
497
diff
changeset
|
16 requires: [ |
c1b77fb96b01
Have consistent requires in classes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
497
diff
changeset
|
17 'Lada.view.widgets.Staat', |
c1b77fb96b01
Have consistent requires in classes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
497
diff
changeset
|
18 'Lada.view.widgets.Verwaltungseinheit' |
c1b77fb96b01
Have consistent requires in classes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
497
diff
changeset
|
19 ], |
c1b77fb96b01
Have consistent requires in classes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
497
diff
changeset
|
20 |
446
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
21 title: 'Neuer Ort', |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
22 |
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 * @private |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
25 * Initialize the view. |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
26 */ |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
27 initComponent: function() { |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
28 var me = this; |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
29 |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
30 var form = Ext.create('Ext.form.Panel', { |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
31 items: [{ |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
32 xtype: 'textfield', |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
33 maxLength: 100, |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
34 name: 'ort_beschreibung', |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
35 fieldLabel: 'Beschreibung' |
491
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
472
diff
changeset
|
36 }, { |
446
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
37 xtype: 'staat', |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
38 name: 'ort_staatId', |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
39 fieldLabel: 'Staat' |
491
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
472
diff
changeset
|
40 }, { |
446
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
41 xtype: 'verwaltungseinheiten', |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
42 name: 'ort_gemId', |
450
e228fecd1577
Set lon/lat coordinates when selecting a verwaltungseinheit.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
446
diff
changeset
|
43 fieldLabel: 'Gemeinde', |
e228fecd1577
Set lon/lat coordinates when selecting a verwaltungseinheit.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
446
diff
changeset
|
44 listeners: { |
e228fecd1577
Set lon/lat coordinates when selecting a verwaltungseinheit.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
446
diff
changeset
|
45 'select': { |
e228fecd1577
Set lon/lat coordinates when selecting a verwaltungseinheit.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
446
diff
changeset
|
46 scope: me, |
497
7c0653e8d9f7
Fixed some js related issues (unused vars, arrays, etc.) and code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
491
diff
changeset
|
47 fn: function(field, newValue) { |
450
e228fecd1577
Set lon/lat coordinates when selecting a verwaltungseinheit.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
446
diff
changeset
|
48 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
|
49 'numberfield[name=ort_longitude]'); |
e228fecd1577
Set lon/lat coordinates when selecting a verwaltungseinheit.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
446
diff
changeset
|
50 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
|
51 'numberfield[name=ort_latitude]'); |
e228fecd1577
Set lon/lat coordinates when selecting a verwaltungseinheit.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
446
diff
changeset
|
52 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
|
53 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
|
54 } |
e228fecd1577
Set lon/lat coordinates when selecting a verwaltungseinheit.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
446
diff
changeset
|
55 } |
e228fecd1577
Set lon/lat coordinates when selecting a verwaltungseinheit.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
446
diff
changeset
|
56 } |
491
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
472
diff
changeset
|
57 }, { |
446
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
58 xtype: 'numberfield', |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
59 name: 'ort_latitude', |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
60 fieldLabel: 'Lat' |
491
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
472
diff
changeset
|
61 }, { |
446
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
62 xtype: 'numberfield', |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
63 name: 'ort_longitude', |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
64 fieldLabel: 'Lon' |
491
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
472
diff
changeset
|
65 }, { |
446
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
66 xtype: 'numberfield', |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
67 name: 'ort_hoeheLand', |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
68 fieldLabel: 'Höhe' |
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 |
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
72 me.items = [form]; |
491
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
472
diff
changeset
|
73 this.buttons = [{ |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
472
diff
changeset
|
74 text: 'Speichern', |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
472
diff
changeset
|
75 scope: form, |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
472
diff
changeset
|
76 action: 'save' |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
472
diff
changeset
|
77 }, { |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
472
diff
changeset
|
78 text: 'Abbrechen', |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
472
diff
changeset
|
79 scope: this, |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
472
diff
changeset
|
80 handler: this.close |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
472
diff
changeset
|
81 }]; |
446
b3e806045a5a
New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
82 this.callParent(arguments); |
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 }); |