X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=blobdiff_plain;f=Pman.Request.js;h=b4db0f0783dd2c3c096a2fea9cc96d53ec154817;hp=9723fa693f953a008cedf24aafe8383ae381a485;hb=refs%2Fheads%2Fwip_edward_T5851_download_old_offer_sheet;hpb=f66b8c9b5c77639ddc09ffed2af764263bdb2716 diff --git a/Pman.Request.js b/Pman.Request.js index 9723fa69..b4db0f07 100644 --- a/Pman.Request.js +++ b/Pman.Request.js @@ -25,7 +25,7 @@ var t = new Pman.Request({ * request, a url encoded string or a function to call to get either. * @cfg {Function} success called with ( JSON decoded data of the data.. ) * @cfg {Function} success called with ( JSON decoded data of the data.. ) -* @cfg {Boolean} showFailtureDialog (true|false) default true +* @cfg {Boolean} showFailureDialog (true|false) default true */ Pman.Request = function(config){ @@ -43,7 +43,7 @@ Pman.Request = function(config){ Roo.extend(Pman.Request, Roo.data.Connection, { // private - showFailtureDialog : true, + showFailureDialog : true, processResponse : function(response) { // convert the Roo Connection response into JSON data. @@ -103,18 +103,20 @@ Roo.extend(Pman.Request, Roo.data.Connection, { if (this.mask && this.maskEl) { Roo.get(this.maskEl).unmask(true); } + if(!this.showFailureDialog){ + return; + } if (res !== true) { var decode = this.processResponse(response); Roo.log(decode); + if (Roo.MessageBox.isVisible()) { alert(decode && decode.errorMsg ? decode.errorMsg : "Error Sending data - return true from failure to remove message"); return; } - if(this.showFailtureDialog){ - Roo.MessageBox.alert("Error", decode && decode.errorMsg ? decode.errorMsg : "Error Sending data"); - } + Roo.MessageBox.alert("Error", decode && decode.errorMsg ? decode.errorMsg : "Error Sending data"); } } -}); \ No newline at end of file +});