# HG changeset patch # User Dustin Demuth # Date 1455291268 -3600 # Node ID 3608842654719e71eb213c1ae00ab70e4c052022 # Parent 2329acae170520005c705bdfcc3723c75417d0a6# Parent 181621463d013be82e51aefe6b104a51f68be2c6 merged error text diff -r 181621463d01 -r 360884265471 app/controller/grid/Status.js --- a/app/controller/grid/Status.js Thu Feb 11 12:10:53 2016 +0100 +++ b/app/controller/grid/Status.js Fri Feb 12 16:34:28 2016 +0100 @@ -41,7 +41,26 @@ gridSave: function(editor, context) { context.record.set('sdatum', new Date()); context.record.save({ - success: function() { + success: function(response) { + var i18n = Lada.getApplication().bundle; + var json = Ext.JSON.decode(response.responseText); + + if(json) { + if (!json.success) { + if(json.message){ + Ext.Msg.alert(i18n.getMsg('err.msg.generic.title') + +' #'+json.message, + i18n.getMsg(json.message)); + } else { + Ext.Msg.alert(i18n.getMsg('err.msg.generic.title'), + i18n.getMsg('err.msg.generic.body')); + } + } else { + Ext.Msg.alert(i18n.getMsg('err.msg.generic.title'), + i18n.getMsg('err.msg.generic.body')); + } + } + context.grid.initData(); var win = context.grid.up('window'); win.initData(); @@ -170,6 +189,22 @@ jsonData: record.getData(), method: 'POST', success: function(response) { + var i18n = Lada.getApplication().bundle; + var json = Ext.JSON.decode(response.responseText); + + if(json) { + if (!json.success) { + if(json.message){ + Ext.Msg.alert(i18n.getMsg('err.msg.generic.title') + +' #'+json.message, + i18n.getMsg(json.message)); + } else { + Ext.Msg.alert(i18n.getMsg('err.msg.generic.title'), + i18n.getMsg('err.msg.generic.body')); + } + } + } + button.up('window').initData(); button.up('grid').initData(); }, @@ -178,9 +213,6 @@ var i18n = Lada.getApplication().bundle; var json = Ext.JSON.decode(response.responseText); if (json) { - if(json.errors.totalCount > 0 || json.warnings.totalCount > 0){ - formPanel.setMessages(json.errors, json.warnings); - } if(json.message){ Ext.Msg.alert(i18n.getMsg('err.msg.generic.title') +' #'+json.message,