Mercurial > lada > lada-client
comparison app/view/orte/CreateForm.js @ 497:7c0653e8d9f7
Fixed some js related issues (unused vars, arrays, etc.) and code style.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Thu, 06 Nov 2014 10:38:17 +0100 |
parents | d07e5086a64b |
children | 8b4ec61c5752 |
comparison
equal
deleted
inserted
replaced
496:d07e5086a64b | 497:7c0653e8d9f7 |
---|---|
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz | 1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz |
2 * Software engineering by Intevation GmbH | 2 * Software engineering by Intevation GmbH |
3 * | 3 * |
4 * This file is Free Software under the GNU GPL (v>=3) | 4 * This file is Free Software under the GNU GPL (v>=3) |
5 * and comes with ABSOLUTELY NO WARRANTY! Check out | 5 * and comes with ABSOLUTELY NO WARRANTY! Check out |
6 * the documentation coming with IMIS-Labordaten-Application for details. | 6 * the documentation coming with IMIS-Labordaten-Application for details. |
7 */ | 7 */ |
8 | 8 |
9 /* | 9 /* |
10 * Formular to create and edit a Ort | 10 * Formular to create and edit a Ort |
11 */ | 11 */ |
12 Ext.define('Lada.view.orte.CreateForm', { | 12 Ext.define('Lada.view.orte.CreateForm', { |
13 extend: 'Lada.view.widgets.LadaForm', | 13 extend: 'Lada.view.widgets.LadaForm', |
14 model: 'Lada.model.Ort', | |
15 requires: [ | 14 requires: [ |
16 'Lada.view.widgets.Ortdetail', | 15 'Lada.view.widgets.Ortdetail', |
17 'Lada.view.widgets.Staat', | 16 'Lada.view.widgets.Staat', |
18 'Lada.view.widgets.Verwaltungseinheit', | 17 'Lada.view.widgets.Verwaltungseinheit', |
19 'Lada.view.orte.CreateOrt' | 18 'Lada.view.orte.CreateOrt' |
20 ], | 19 ], |
20 | |
21 model: 'Lada.model.Ort', | |
21 edit: false, | 22 edit: false, |
23 | |
22 initComponent: function() { | 24 initComponent: function() { |
23 this.items = [{ | 25 this.items = [{ |
24 xtype: 'ortdetail', | 26 xtype: 'ortdetail', |
25 name: 'ortId', | 27 name: 'ortId', |
26 fieldLabel: 'Ort', | 28 fieldLabel: 'Ort', |
27 listeners: { | 29 listeners: { |
28 scope: this, | 30 scope: this, |
29 'change': function (field, newv, oldv, opts) { | 31 'change': function(field, newv) { |
30 if (field.up('window')) { | 32 if (field.up('window')) { |
31 field.up('window').down('fieldset').show(); | 33 field.up('window').down('fieldset').show(); |
32 } | 34 } |
33 var orte = Ext.data.StoreManager.get('staOrte'); | 35 var orte = Ext.data.StoreManager.get('staOrte'); |
34 var ort = orte.getById(newv); | 36 var ort = orte.getById(newv); |
52 verw.load({ | 54 verw.load({ |
53 id: ort.get('gemId') | 55 id: ort.get('gemId') |
54 }); | 56 }); |
55 } | 57 } |
56 | 58 |
59 console.log('found verw'); | |
57 var form = this.getForm(); | 60 var form = this.getForm(); |
58 if ( ort != undefined ) { | 61 var ffield = null; |
59 for (var i = fields.length - 1; i >= 0; i--){ | 62 if (ort) { |
60 ffield = form.findField("ort_"+fields[i]); | 63 for (var i = fields.length - 1; i >= 0; i--) { |
64 ffield = form.findField('ort_' + fields[i]); | |
61 ffield.setValue(ort.get(fields[i])); | 65 ffield.setValue(ort.get(fields[i])); |
62 } | 66 } |
63 } | 67 } |
64 } | 68 } |
65 } | 69 } |