comparison app/controller/form/Ortszuordnung.js @ 1336:f879c806f880

Create orte store for grid to have only orte with the correct netzbetreiberId
author Raimund Renkert <raimund.renkert@intevation.de>
date Fri, 03 Feb 2017 17:43:23 +0100
parents cba4e0b0e336
children 1a2cd9bef6d7
comparison
equal deleted inserted replaced
1335:cba4e0b0e336 1336:f879c806f880
148 win.setHeight(Ext.getBody().getViewSize().height - 50); 148 win.setHeight(Ext.getBody().getViewSize().height - 50);
149 button.setText(i18n.getMsg('ortszuordnung.form.setOrt.pressed')); 149 button.setText(i18n.getMsg('ortszuordnung.form.setOrt.pressed'));
150 map.featureLayer.setVisibility(true); 150 map.featureLayer.setVisibility(true);
151 win.setY(25); 151 win.setY(25);
152 gridPanel.show(); 152 gridPanel.show();
153 osg.store.load({params: {netzbetreiberId: oForm.record.get('netzbetreiberId')}}); 153 var mstId = oForm.up('window').probe ? oForm.up('window').probe.get('mstId') :
154 oForm.up('window').messprogramm.get('mstId');
155 var mst = Ext.data.StoreManager.get('messstellen');
156 var ndx = mst.findExact('id', mstId);
157 var nId = mst.getAt(ndx).get('netzbetreiberId');
158 var store = Ext.create('Lada.store.Orte', {
159 defaultPageSize: 0,
160 listeners: {
161 beforeload: {
162 fn: function() {
163 osg.setLoading(true);
164 }
165 },
166 load: {
167 fn: function() {
168 osg.setLoading(false);
169 osg.setStore(store);
170 osg.store.filterBy(function(record) {
171 if (record.get('netzbetreiberId') ===
172 nId) {
173 return true;
174 }
175 });
176 }
177 }
178 }
179 });
154 win.doLayout(); 180 win.doLayout();
155 osg.addListener('select',oForm.setOrt, oForm); 181 osg.addListener('select',oForm.setOrt, oForm);
156 182
157 } 183 }
158 else { 184 else {

http://lada.wald.intevation.org