Mercurial > lada > lada-client
comparison app/controller/grid/Messwert.js @ 701:f0bc5387abcc
Added failure - Messages
author | Dustin Demuth <dustin@intevation.de> |
---|---|
date | Fri, 27 Mar 2015 09:38:13 +0100 |
parents | 8acb3123b46c |
children | efb1369a8cac |
comparison
equal
deleted
inserted
replaced
700:1e76aec72815 | 701:f0bc5387abcc |
---|---|
24 }); | 24 }); |
25 }, | 25 }, |
26 | 26 |
27 gridSave: function(editor, context) { | 27 gridSave: function(editor, context) { |
28 context.record.save({ | 28 context.record.save({ |
29 success: function() { | 29 success: function(request, response) { |
30 context.grid.store.reload(); | 30 context.grid.store.reload(); |
31 context.grid.up('window').initData(); | 31 context.grid.up('window').initData(); |
32 }, | 32 }, |
33 failure: function() { | 33 failure: function(request, response) { |
34 // TODO | 34 var json = response.request.scope.reader.jsonData; |
35 if (json) { | |
36 if (json.message){ | |
37 Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title') | |
38 +' #'+json.message, | |
39 Lada.getApplication().bundle.getMsg(json.message)); | |
40 } else { | |
41 Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title'), | |
42 Lada.getApplication().bundle.getMsg('err.msg.generic.body')); | |
43 } | |
44 } else { | |
45 Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title'), | |
46 Lada.getApplication().bundle.getMsg('err.msg.response.body')); | |
47 } | |
35 } | 48 } |
36 }); | 49 }); |
37 }, | 50 }, |
38 | 51 |
39 cancelEdit: function(editor, context) { | 52 cancelEdit: function(editor, context) { |
59 selection.destroy({ | 72 selection.destroy({ |
60 success: function() { | 73 success: function() { |
61 button.up('window').initData(); | 74 button.up('window').initData(); |
62 grid.initData(); | 75 grid.initData(); |
63 }, | 76 }, |
64 failure: function() { | 77 failure: function(request, response) { |
65 // TODO | 78 var json = response.request.scope.reader.jsonData; |
79 if (json) { | |
80 if (json.message){ | |
81 Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.delete.title') | |
82 +' #'+json.message, | |
83 Lada.getApplication().bundle.getMsg(json.message)); | |
84 } else { | |
85 Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.delete.title'), | |
86 Lada.getApplication().bundle.getMsg('err.msg.generic.body')); | |
87 } | |
88 } else { | |
89 Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.delete.title'), | |
90 Lada.getApplication().bundle.getMsg('err.msg.response.body')); | |
91 } | |
66 } | 92 } |
67 }); | 93 }); |
68 } | 94 } |
69 }); | 95 }); |
70 } | 96 } |