annotate app/view/orte/CreateOrt.js @ 496:d07e5086a64b

Moved stammdaten stores to app.js and load them via storemanager.
author Raimund Renkert <raimund.renkert@intevation.de>
date Thu, 06 Nov 2014 10:35:35 +0100
parents 850ccfe5f3c4
children 7c0653e8d9f7
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'
491
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 472
diff changeset
30 }, {
446
b3e806045a5a New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
31 xtype: 'staat',
b3e806045a5a New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
32 name: 'ort_staatId',
b3e806045a5a New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
33 fieldLabel: 'Staat'
491
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 472
diff changeset
34 }, {
446
b3e806045a5a New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
35 xtype: 'verwaltungseinheiten',
b3e806045a5a New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
36 name: 'ort_gemId',
450
e228fecd1577 Set lon/lat coordinates when selecting a verwaltungseinheit.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 446
diff changeset
37 fieldLabel: 'Gemeinde',
e228fecd1577 Set lon/lat coordinates when selecting a verwaltungseinheit.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 446
diff changeset
38 listeners: {
e228fecd1577 Set lon/lat coordinates when selecting a verwaltungseinheit.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 446
diff changeset
39 'select': {
e228fecd1577 Set lon/lat coordinates when selecting a verwaltungseinheit.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 446
diff changeset
40 scope: me,
e228fecd1577 Set lon/lat coordinates when selecting a verwaltungseinheit.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 446
diff changeset
41 fn: function(field, newValue, oldValue) {
e228fecd1577 Set lon/lat coordinates when selecting a verwaltungseinheit.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 446
diff changeset
42 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
43 'numberfield[name=ort_longitude]');
e228fecd1577 Set lon/lat coordinates when selecting a verwaltungseinheit.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 446
diff changeset
44 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
45 'numberfield[name=ort_latitude]');
e228fecd1577 Set lon/lat coordinates when selecting a verwaltungseinheit.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 446
diff changeset
46 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
47 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
48 }
e228fecd1577 Set lon/lat coordinates when selecting a verwaltungseinheit.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 446
diff changeset
49 }
e228fecd1577 Set lon/lat coordinates when selecting a verwaltungseinheit.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 446
diff changeset
50 }
491
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 472
diff changeset
51 }, {
446
b3e806045a5a New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
52 xtype: 'numberfield',
b3e806045a5a New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
53 name: 'ort_latitude',
b3e806045a5a New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
54 fieldLabel: 'Lat'
491
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 472
diff changeset
55 }, {
446
b3e806045a5a New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
56 xtype: 'numberfield',
b3e806045a5a New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
57 name: 'ort_longitude',
b3e806045a5a New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
58 fieldLabel: 'Lon'
491
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 472
diff changeset
59 }, {
446
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_hoeheLand',
b3e806045a5a New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
62 fieldLabel: 'Höhe'
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
b3e806045a5a New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
66 me.items = [form];
491
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 472
diff changeset
67 this.buttons = [{
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 472
diff changeset
68 text: 'Speichern',
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 472
diff changeset
69 scope: form,
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 472
diff changeset
70 action: 'save'
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 472
diff changeset
71 }, {
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 472
diff changeset
72 text: 'Abbrechen',
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 472
diff changeset
73 scope: this,
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 472
diff changeset
74 handler: this.close
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 472
diff changeset
75 }];
446
b3e806045a5a New view to create ort details.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
76 this.callParent(arguments);
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

http://lada.wald.intevation.org