# HG changeset patch # User Dustin Demuth # Date 1427386993 -3600 # Node ID 5b2cbc6bc39ab9df4c50b1c57a1a5cca64eff564 # Parent b0f1dcdf981d0bc4ea3d5f590a64b82ce35139b2 Display Error Message on Failure diff -r b0f1dcdf981d -r 5b2cbc6bc39a app/controller/grid/MKommentar.js --- 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)); + } + } } }); }, diff -r b0f1dcdf981d -r 5b2cbc6bc39a app/controller/grid/Probenzusatzwert.js --- a/app/controller/grid/Probenzusatzwert.js Thu Mar 26 16:26:24 2015 +0100 +++ b/app/controller/grid/Probenzusatzwert.js Thu Mar 26 17:23:13 2015 +0100 @@ -30,8 +30,17 @@ context.grid.store.reload(); context.grid.up('window').initData(); }, - failure: function() { - // TODO + failure: function(record, response) { + console.log(response); + console.log(record); + 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)); + } + } } }); },