comparison app/controller/grid/MKommentar.js @ 701:f0bc5387abcc

Added failure - Messages
author Dustin Demuth <dustin@intevation.de>
date Fri, 27 Mar 2015 09:38:13 +0100
parents 1e76aec72815
children 6e28ebbe1a73
comparison
equal deleted inserted replaced
700:1e76aec72815 701:f0bc5387abcc
32 }, 32 },
33 failure: function(record, response) { 33 failure: function(record, response) {
34 var json = response.request.scope.reader.jsonData; 34 var json = response.request.scope.reader.jsonData;
35 if (json) { 35 if (json) {
36 if (json.message){ 36 if (json.message){
37 Ext.Msg.alert(Lada.getApplication().bundle.getMsg('errmsgtitle') 37 Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title')
38 +' '+json.message, 38 +' #'+json.message,
39 Lada.getApplication().bundle.getMsg(json.message)); 39 Lada.getApplication().bundle.getMsg(json.message));
40 } 40 } else {
41 } 41 Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title'),
42 Lada.getApplication().bundle.getMsg('err.msg.generic.body'));
43 }
44 }
42 } 45 }
43 }); 46 });
44 }, 47 },
45 48
46 cancelEdit: function(editor, context) { 49 cancelEdit: function(editor, context) {
64 if (btn === 'yes') { 67 if (btn === 'yes') {
65 selection.destroy({ 68 selection.destroy({
66 success: function() { 69 success: function() {
67 button.up('window').initData(); 70 button.up('window').initData();
68 }, 71 },
69 failure: function() { 72 failure: function(request, response) {
70 // TODO 73 var json = response.request.scope.reader.jsonData;
74 if (json) {
75 if (json.message){
76 Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.delete.title')
77 +' #'+json.message,
78 Lada.getApplication().bundle.getMsg(json.message));
79 } else {
80 Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.delete.title'),
81 Lada.getApplication().bundle.getMsg('err.msg.generic.body'));
82 }
83 } else {
84 Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.delete.title'),
85 Lada.getApplication().bundle.getMsg('err.msg.response.body'));
86 }
71 } 87 }
72 }); 88 });
73 } 89 }
74 }); 90 });
75 } 91 }

http://lada.wald.intevation.org