'Increasing Ajax request timeout in ExtJs
Is there one single configuration in ExtJs library to increase Ajax request timeout?
I have tried following two configurations but neither helped:
Ext.override(Ext.data.Connection, {
timeout: 60000
});
Ext.Ajax.timeout = 60000;
Solution 1:[1]
I used the 2 that you mentioned, but also had to override these:
Ext.override(Ext.data.proxy.Ajax, { timeout: 60000 });
Ext.override(Ext.form.action.Action, { timeout: 60 });
Update for ExtJS 5:
It looks like you now need to set the Ext.Ajax timeout using setTimeout()
for ExtJS 5+, instead of just setting the property:
Ext.Ajax.setTimeout(60000);
Solution 2:[2]
I had to do below one :
Ext.Ajax.timeout= 60000;
Ext.override(Ext.form.Basic, { timeout: Ext.Ajax.timeout / 1000 });
Ext.override(Ext.data.proxy.Server, { timeout: Ext.Ajax.timeout });
Ext.override(Ext.data.Connection, { timeout: Ext.Ajax.timeout });
Solution 3:[3]
I've found this is the best change for ExtJS 4 (tested on 4.2.3):
// Connection uses its own timeout value hardcoded in ExtJS - we remove it so that Ext.data.Connection will then
// fallback to using Ext.Ajax.timeout, thus giving a single place for setting the timeout
// Bonus: you can change this at runtime
Ext.define('Monitoring.overrides.Connection', {
override: 'Ext.data.Connection',
constructor: function() {
delete this.timeout;
this.callParent(arguments);
}
});
Ext.define('Monitoring.overrides.ProxyServer', {
override: 'Ext.data.proxy.Server',
constructor: function() {
delete this.timeout;
this.callParent(arguments);
}
});
Now you can use Ext.Ajax.timeout and it will change all the AJAX calls (don't know about form submission).
Solution 4:[4]
This solution doesn't work for me:
Ext.Ajax.timeout = 60000
Then i found an other solution from ExtJS Docs (https://docs.sencha.com/extjs/7.5.0/classic/Ext.Ajax.html). It is the same solution as @kevhender mentioned before. This works for me (ExtJS version 7.5):
Ext.Ajax.setTimeout(60000)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | |
Solution 2 | Snehal Masne |
Solution 3 | Ton Voon |
Solution 4 | Quan Nguyen |