PDA

View Full Version : Ext.util.JSONP.request has no timeout config



perry_jia
22 Mar 2011, 6:50 PM
Ext.util.JSONP.request({
url
params
callbackKey
callback
scope
})

JSON has no timeout or failure ? But look at Ajax:

Ext.Ajax.request({
url: 'ajax_demo/sample.json',
success: function(response, opts) {
},
failure: function(response, opts) {
},
timeout: function(){
}
});

why?

wildaker
4 Apr 2011, 11:56 AM
Is this something that can be handled by a plugin? It would be hugely useful...

ITS Telco
26 Jul 2011, 4:55 AM
Hello wildaker,

I solve the problem on this way.
First before the request start I set a timer:

alertTimerId = window.setTimeout("timeout_req()", 5000); // for 5 sec

In the function timeout_req I call the callback manually:

Ext.util.JSONP.callback({'error':'timeout'});

For my issue it seems it works. Maybe it is a help for you , too.

best regards
Thomas

jusmeig
20 Jul 2012, 1:20 AM
Maybe it was only added, but it has one now :)