diff app/controller/grid/MKommentar.js @ 697:5b2cbc6bc39a

Display Error Message on Failure
author Dustin Demuth <dustin@intevation.de>
date Thu, 26 Mar 2015 17:23:13 +0100
parents 8acb3123b46c
children 1e76aec72815
line wrap: on
line diff
--- a/app/controller/grid/MKommentar.js	Thu Mar 26 16:26:24 2015 +0100
+++ b/app/controller/grid/MKommentar.js	Thu Mar 26 17:23:13 2015 +0100
@@ -26,12 +26,19 @@
 
     edit: function(editor, context) {
         context.record.save({
-            success: function() {
+            success: function(record, response) {
                 context.grid.initData();
                 context.grid.up('window').initData();
             },
-            failure: function() {
-                // TODO
+            failure: function(record, response) {
+              var json = response.request.scope.reader.jsonData;
+              if (json) {
+                if (json.message){
+                    Ext.Msg.alert(Lada.getApplication().bundle.getMsg('errmsgtitle')
+                        +' '+json.message,
+                        Lada.getApplication().bundle.getMsg(json.message));
+                    }
+                }
             }
         });
     },

http://lada.wald.intevation.org