[Lada-commits] [PATCH] using callback differently for statuswerte

Wald Commits scm-commit at wald.intevation.org
Mon Nov 9 12:53:47 CET 2015


# HG changeset patch
# User Dustin Demuth <dustin at intevation.de>
# Date 1447070016 -3600
# Node ID b401846e781795171ac57ab7bf2881e7db57e9af
# Parent  1856b6b3b8d4ea5ef52f1c8f4236c9b447994a0f
using callback differently for statuswerte

diff -r 1856b6b3b8d4 -r b401846e7817 app/view/form/Messung.js
--- a/app/view/form/Messung.js	Wed Nov 04 19:44:44 2015 +0100
+++ b/app/view/form/Messung.js	Mon Nov 09 12:53:36 2015 +0100
@@ -176,8 +176,9 @@
         if (!swStore) {
             var swStore = Ext.create('Lada.store.StatusWerte');
         }
-        swStore.on('load',
-            function(records, operation, success) {
+        swStore.load({
+            scope: this,
+            callback: function(records, operation, success) {
                 var i18n = Lada.getApplication().bundle;
                 var msg = i18n.getMsg('load.statuswert.error');
                 var textfield = this.down('[name=status]');
@@ -186,8 +187,7 @@
                 }
                 textfield.setRawValue(msg);
             },
-            this);
-        swStore.load();
+        });
     },
 
     setMessages: function(errors, warnings) {
diff -r 1856b6b3b8d4 -r b401846e7817 app/view/grid/Messung.js
--- a/app/view/grid/Messung.js	Wed Nov 04 19:44:44 2015 +0100
+++ b/app/view/grid/Messung.js	Mon Nov 09 12:53:36 2015 +0100
@@ -223,11 +223,7 @@
                 scope: this,
                 callback: function(records, operation, success) {
                     if (success) {
-                        try {
-                            val = sta.getById(value).get('wert');
-                        }
-                        catch (e) {
-                        }
+                        val = sta.getById(value).get('wert');
                     }
                     Ext.fly(opts.divId).update(val);
                 }


More information about the Lada-commits mailing list