PDA

View Full Version : [FIXED] Ajax Request timeout



Champi
22 Sep 2011, 5:36 PM
Hi!

seems to be a bug there :


abort : function(r) {
if (r && this.isLoading(r)) {
if (!request.timedout) {sencha-touch-debug.js:17491Uncaught ReferenceError: request is not defined}



request.aborted = true;
}

r.xhr.abort();
}
else if (!r) {
var id;
for(id in this.requests) {
if (!this.requests.hasOwnProperty(id)) {
continue;
}
this.abort(this.requests[id]);
}
}
},

mitchellsimoens
23 Sep 2011, 4:56 AM
Looks like the abort method in the Connection.js file has been rewritten to fix this issue in 1.1.1. All it looks like is it change the 'r' arguments/variables to 'request' as that was the bug in the first place. We shouldn't really use short variables like that in the first place, minification will handle that.

hranum
16 Apr 2012, 12:34 AM
I don't think so. My copy of 1.1.1 still has this error.

Fixed it myself:



Ext.override(Ext.data.Connection, {

abort : function(r) {
if (r && this.isLoading(r)) {
if (!r.timedout) {
r.aborted = true;
}
// Will fire an onreadystatechange event
r.xhr.abort();
}
else if (!r) {
var id;
for(id in this.requests) {
if (!this.requests.hasOwnProperty(id)) {
continue;
}
this.abort(this.requests[id]);
}
}
}

});