X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=blobdiff_plain;f=Pman.Request.js;h=b4db0f0783dd2c3c096a2fea9cc96d53ec154817;hp=5cf0aae0b0e31270e4ae7ec239d616a215ac95c4;hb=refs%2Fheads%2Fwip_edward_T5851_download_old_offer_sheet;hpb=39c85018f739996b3c6286c5ed788d3862b9a4ee diff --git a/Pman.Request.js b/Pman.Request.js index 5cf0aae0..b4db0f07 100644 --- a/Pman.Request.js +++ b/Pman.Request.js @@ -25,6 +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} showFailureDialog (true|false) default true */ Pman.Request = function(config){ @@ -33,8 +34,6 @@ Pman.Request = function(config){ if (this.mask) { this.maskEl = this.maskEl || Roo.get(document.body); - Roo.log('mask EL !!!!!!!!!!!!!!!!!!!!!!!!!!11'); - Roo.log(this.maskEl); Roo.get(this.maskEl).mask(this.mask); } @@ -44,6 +43,8 @@ Pman.Request = function(config){ Roo.extend(Pman.Request, Roo.data.Connection, { // private + showFailureDialog : true, + processResponse : function(response) { // convert the Roo Connection response into JSON data. @@ -76,7 +77,7 @@ Roo.extend(Pman.Request, Roo.data.Connection, { this.fireEvent("requestcomplete", this, response, options); if (this.mask && this.maskEl) { - Roo.get(this.maskEl).unmask(false); + Roo.get(this.maskEl).unmask(true); } var res = this.processResponse(response); @@ -102,14 +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; - } + } + Roo.MessageBox.alert("Error", decode && decode.errorMsg ? decode.errorMsg : "Error Sending data"); + } } -}); \ No newline at end of file +});