Mercurial > lada > lada-client
comparison app/view/form/Messung.js @ 955:b401846e7817
using callback differently for statuswerte
author | Dustin Demuth <dustin@intevation.de> |
---|---|
date | Mon, 09 Nov 2015 12:53:36 +0100 |
parents | c7bf0b459074 |
children | 881984972e0e |
comparison
equal
deleted
inserted
replaced
954:1856b6b3b8d4 | 955:b401846e7817 |
---|---|
174 setStatusWert: function(value){ | 174 setStatusWert: function(value){ |
175 var swStore = Ext.StoreManager.lookup('StatusWerte'); | 175 var swStore = Ext.StoreManager.lookup('StatusWerte'); |
176 if (!swStore) { | 176 if (!swStore) { |
177 var swStore = Ext.create('Lada.store.StatusWerte'); | 177 var swStore = Ext.create('Lada.store.StatusWerte'); |
178 } | 178 } |
179 swStore.on('load', | 179 swStore.load({ |
180 function(records, operation, success) { | 180 scope: this, |
181 callback: function(records, operation, success) { | |
181 var i18n = Lada.getApplication().bundle; | 182 var i18n = Lada.getApplication().bundle; |
182 var msg = i18n.getMsg('load.statuswert.error'); | 183 var msg = i18n.getMsg('load.statuswert.error'); |
183 var textfield = this.down('[name=status]'); | 184 var textfield = this.down('[name=status]'); |
184 if (success) { | 185 if (success) { |
185 msg = swStore.getById(value).get('wert'); | 186 msg = swStore.getById(value).get('wert'); |
186 } | 187 } |
187 textfield.setRawValue(msg); | 188 textfield.setRawValue(msg); |
188 }, | 189 }, |
189 this); | 190 }); |
190 swStore.load(); | |
191 }, | 191 }, |
192 | 192 |
193 setMessages: function(errors, warnings) { | 193 setMessages: function(errors, warnings) { |
194 var key; | 194 var key; |
195 var element; | 195 var element; |