comparison app/view/orte/CreateForm.js @ 429:608a1784a8ac

Load currently "selected" verwaltungseinheit when changing the selection.
author Torsten Irländer <torsten.irlaender@intevation.de>
date Fri, 08 Nov 2013 12:46:24 +0100
parents 1536fb5c81b7
children 4206cb30138c
comparison
equal deleted inserted replaced
428:651ee49ff3c2 429:608a1784a8ac
21 console.log(field, oldv, newv, opts); 21 console.log(field, oldv, newv, opts);
22 var orte = Ext.getStore('Ortedetails'); 22 var orte = Ext.getStore('Ortedetails');
23 var ort = orte.getById(newv); 23 var ort = orte.getById(newv);
24 var fields = ['beschreibung', 'bezeichnung', 'hoeheLand', 24 var fields = ['beschreibung', 'bezeichnung', 'hoeheLand',
25 'latitude', 'longitude', 'staatId', 'gemId']; 25 'latitude', 'longitude', 'staatId', 'gemId'];
26
27 // Load currently "selected" verwaltungseinheit. This
28 // is needed as without having this record the field
29 // would only display the raw value (id) of the
30 // verwaltungseinheit.
31 var verw = Ext.getStore('Verwaltungseinheiten');
32 verw.load({
33 id: ort.get('gemId')
34 });
35
26 var form = this.getForm(); 36 var form = this.getForm();
27 if ( ort != undefined ) { 37 if ( ort != undefined ) {
28 console.log('Found ort'); 38 console.log('Found ort');
29 for (var i = fields.length - 1; i >= 0; i--){ 39 for (var i = fields.length - 1; i >= 0; i--){
30 ffield = form.findField("ort_"+fields[i]); 40 ffield = form.findField("ort_"+fields[i]);

http://lada.wald.intevation.org