Mercurial > lada > lada-client
comparison app/view/form/Ortszuordnung.js @ 1049:1bd4c0709bd6 stammdatengrids
Working version of selectable 'ort' in map and grid.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Tue, 01 Mar 2016 11:50:39 +0100 |
parents | 6d33a84979e4 |
children | 981339d774b8 |
comparison
equal
deleted
inserted
replaced
1028:2e7adc19b4fe | 1049:1bd4c0709bd6 |
---|---|
69 }] | 69 }] |
70 }], | 70 }], |
71 items: [{ | 71 items: [{ |
72 layout: 'vbox', | 72 layout: 'vbox', |
73 border: 0, | 73 border: 0, |
74 margin: '0, 10, 0, 0', | |
74 items: [{ | 75 items: [{ |
75 xtype: 'tfield', | 76 xtype: 'tfield', |
77 labelWidth: 125, | |
76 maxLength: 100, | 78 maxLength: 100, |
77 name: 'ortszusatztext', | 79 name: 'ortszusatztext', |
78 fieldLabel: i18n.getMsg('ortszuordnung.form.field.ortszusatztext'), | 80 fieldLabel: i18n.getMsg('ortszuordnung.form.field.ortszusatztext') |
79 }, { | 81 }, { |
80 xtype: 'tfield', | 82 xtype: 'tfield', |
83 labelWidth: 125, | |
81 maxLength: 100, | 84 maxLength: 100, |
82 name: 'ortszuordnungTyp', | 85 name: 'ortszuordnungTyp', |
83 fieldLabel: i18n.getMsg('ortszuordnung.form.field.ortszuordnungtyp'), | 86 fieldLabel: i18n.getMsg('ortszuordnung.form.field.ortszuordnungtyp') |
84 }, { | 87 }, { |
85 xtype: 'textfield', | 88 xtype: 'textfield', |
86 submitValue: true, | 89 submitValue: true, |
87 readOnly: true, | 90 readOnly: true, |
88 hidden: true, | 91 hidden: true, |
89 name: 'ortId' | 92 name: 'ortId' |
90 }] | 93 }] |
91 }, { | 94 }, { |
92 layout: 'vbox', | 95 layout: 'vbox', |
96 flex: 1, | |
97 margin: '0, 10, 0, 0', | |
93 border: 0, | 98 border: 0, |
94 items: [{ | 99 items: [{ |
95 xtype: 'displayfield', | 100 xtype: 'displayfield', |
96 fieldLabel: i18n.getMsg('orte.gemId'), | 101 labelWidth: 125, |
97 name: 'gemId' | 102 fieldLabel: i18n.getMsg('orte.gemeinde'), |
98 }, { | |
99 xtype: 'displayfield', | |
100 fieldLabel: i18n.getMsg('Gemeinde'), | |
101 name: 'gemeinde' | 103 name: 'gemeinde' |
102 }, { | 104 }, { |
103 xtype: 'displayfield', | 105 xtype: 'displayfield', |
106 labelWidth: 125, | |
104 fieldLabel: i18n.getMsg('staat'), | 107 fieldLabel: i18n.getMsg('staat'), |
105 name: 'staat' | 108 name: 'staat' |
109 }] | |
110 }, { | |
111 layout: 'vbox', | |
112 flex: 1, | |
113 margin: '0, 10, 0, 0', | |
114 border: 0, | |
115 items: [{ | |
116 xtype: 'displayfield', | |
117 labelWidth: 125, | |
118 fieldLabel: i18n.getMsg('orte.lon'), | |
119 name: 'lon' | |
120 }, { | |
121 xtype: 'displayfield', | |
122 labelWidth: 125, | |
123 fieldLabel: i18n.getMsg('orte.lat'), | |
124 name: 'lat' | |
106 }] | 125 }] |
107 }] | 126 }] |
108 }] | 127 }] |
109 }]; | 128 }]; |
110 this.callParent(arguments); | 129 this.callParent(arguments); |
125 }, | 144 }, |
126 | 145 |
127 refreshOrt: function(ortId) { | 146 refreshOrt: function(ortId) { |
128 var orteStore = Ext.StoreManager.get('orte'); | 147 var orteStore = Ext.StoreManager.get('orte'); |
129 var ort = orteStore.getById(ortId); | 148 var ort = orteStore.getById(ortId); |
130 var verwStore = Ext.StoreManager.get('verwaltungseinheiten'); | 149 var verwStore = Ext.StoreManager.get('verwaltungseinheiten'); |
131 var verw = verwStore.getById(ort.get('gemId')); | 150 var verw = verwStore.getById(ort.get('gemId')); |
132 var staatStore = Ext.StoreManager.get('staaten'); | 151 var staatStore = Ext.StoreManager.get('staaten'); |
133 var staat = staatStore.getById(ort.get('staatId')); | 152 var staat = staatStore.getById(ort.get('staatId')); |
153 console.log(ort); | |
134 | 154 |
135 this.getForm().setValues({ | 155 this.getForm().setValues({ |
136 gemId: ort.get('gemId'), | |
137 gemeinde: verw.get('bezeichnung'), | 156 gemeinde: verw.get('bezeichnung'), |
138 staat: staat.get('staatIso') | 157 staat: staat.get('staatIso'), |
158 lon: ort.get('longitude'), | |
159 lat: ort.get('latitude') | |
139 }); | 160 }); |
140 }, | 161 }, |
141 | 162 |
142 /** | 163 /** |
143 * setOrt can be called from a CallbackFunction, ie select from a grid. | 164 * setOrt can be called from a CallbackFunction, ie select from a grid. |