Mercurial > lada > lada-client
comparison app/view/orte/CreateForm.js @ 149:26ac4c99f8c4
Added Orte.
author | Torsten Irländer <torsten.irlaender@intevation.de> |
---|---|
date | Mon, 01 Jul 2013 17:05:03 +0200 |
parents | 2308094f5a8c |
children | 16ba7e2465fd |
comparison
equal
deleted
inserted
replaced
148:ed7fb4fa32dc | 149:26ac4c99f8c4 |
---|---|
1 Ext.define('Lada.view.orte.CreateForm', { | 1 Ext.define('Lada.view.orte.CreateForm', { |
2 extend: 'Lada.view.widgets.LadaForm', | 2 extend: 'Lada.view.widgets.LadaForm', |
3 model: 'Lada.model.Ort', | 3 model: 'Lada.model.Ort', |
4 requires: [ | |
5 'Lada.view.widgets.Ortdetail', | |
6 'Lada.view.widgets.Staat', | |
7 'Lada.view.widgets.Verwaltungseinheit' | |
8 ], | |
4 initComponent: function() { | 9 initComponent: function() { |
5 this.items = [ | 10 this.items = [ |
6 //{ | 11 { |
7 // xtype: 'textfield', | 12 xtype: 'ortdetail', |
8 // name: 'erzeuger', | 13 name: 'ortId', |
9 // fieldLabel: 'Erzeuger' | 14 fieldLabel: 'Ort', |
10 //}, | 15 listeners: { |
11 //{ | 16 scope: this, |
12 // xtype: 'datefield', | 17 'change': function (field, newv, oldv, opts) { |
13 // name: 'kdatum', | 18 console.log(field, oldv, newv, opts); |
14 // fieldLabel: 'Datum' | 19 var orte = Ext.getStore('Ortedetails'); |
15 //}, | 20 var ort = orte.getById(newv); |
16 //{ | 21 var fields = ['beschreibung', 'bezeichnung', 'hoeheLand', |
17 // xtype: 'textareafield', | 22 'latitude', 'longitude', 'staatId', 'gemId']; |
18 // name: 'ktext', | 23 var form = this.getForm(); |
19 // fieldLabel: 'Text' | 24 if ( ort != undefined ) { |
20 //} | 25 console.log('Found ort'); |
26 for (var i = fields.length - 1; i >= 0; i--){ | |
27 ffield = form.findField("ort_"+fields[i]); | |
28 ffield.setValue(ort.get(fields[i])); | |
29 ffield.setReadOnly(true); | |
30 } | |
31 } else { | |
32 this.setReadOnly(false); | |
33 } | |
34 } | |
35 } | |
36 }, | |
37 { | |
38 xtype: 'textfield', | |
39 name: 'ortsTyp', | |
40 maxLength: 1, | |
41 fieldLabel: 'Type' | |
42 }, | |
43 { | |
44 xtype: 'textareafield', | |
45 name: 'ortszusatztext', | |
46 maxLength: 100, | |
47 fieldLabel: 'Ortszusatz' | |
48 }, | |
49 { | |
50 xtype: 'fieldset', | |
51 title: 'Ortsangaben', | |
52 defaults: { | |
53 labelWidth: 150 | |
54 }, | |
55 items: [ | |
56 { | |
57 xtype: 'textfield', | |
58 name: 'ort_beschreibung', | |
59 fieldLabel: 'Beschreibung' | |
60 }, | |
61 { | |
62 xtype: 'textfield', | |
63 name: 'ort_bezeichnung', | |
64 fieldLabel: 'Bezeichnung' | |
65 }, | |
66 { | |
67 xtype: 'staat', | |
68 name: 'ort_staatId', | |
69 fieldLabel: 'Staat' | |
70 }, | |
71 { | |
72 xtype: 'verwaltungseinheiten', | |
73 name: 'ort_gemId', | |
74 fieldLabel: 'Gemeinde' | |
75 }, | |
76 { | |
77 xtype: 'textfield', | |
78 name: 'ort_latitude', | |
79 fieldLabel: 'Lat' | |
80 }, | |
81 { | |
82 xtype: 'textfield', | |
83 name: 'ort_longitude', | |
84 fieldLabel: 'Lon' | |
85 }, | |
86 { | |
87 xtype: 'textfield', | |
88 name: 'ort_hoeheLand', | |
89 fieldLabel: 'Höhe' | |
90 } | |
91 ] | |
92 } | |
21 ]; | 93 ]; |
22 this.callParent(); | 94 this.callParent(); |
95 }, | |
96 updateOrtInfo: function(field, oldv, newv, opts) { | |
97 console.log(field, oldv, newv, opts); | |
23 } | 98 } |
24 }); | 99 }); |