diff app/controller/grid/Messung.js @ 704:2d454bfef426

Further Failure Messages
author Dustin Demuth <dustin@intevation.de>
date Fri, 27 Mar 2015 11:22:35 +0100
parents e88381fb3bdb
children cc9107d9be17
line wrap: on
line diff
--- a/app/controller/grid/Messung.js	Fri Mar 27 11:03:10 2015 +0100
+++ b/app/controller/grid/Messung.js	Fri Mar 27 11:22:35 2015 +0100
@@ -65,6 +65,20 @@
                             button.up('window').initData();
                         },
                         failure: function() {
+                            var json = response.request.scope.reader.jsonData;
+                            if (json) {
+                                if (json.message){
+                                    Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.delete.title')
+                                        +' #'+json.message,
+                                        Lada.getApplication().bundle.getMsg(json.message));
+                                } else {
+                                    Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.delete.title'),
+                                        Lada.getApplication().bundle.getMsg('err.msg.generic.body'));
+                                }
+                            } else {
+                                Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.delete.title'),
+                                    Lada.getApplication().bundle.getMsg('err.msg.response.body'));
+                            }
                         }
                     });
                 }

http://lada.wald.intevation.org