EXTJS4: Set global default Ajax timeout for sencha application
Version Info: Ext JS 4.2x
If we want to increase the timeout globally across my application. ExtJS documentation makes it look like setting Ext.Ajax.timeout will increase all timeouts, it’s just not true.
This code sets 5 mins for forms, stores and ajax proxies calls within MVC application.
Code snippet:
Version Info: Ext JS 4.2x
If we want to increase the timeout globally across my application. ExtJS documentation makes it look like setting Ext.Ajax.timeout will increase all timeouts, it’s just not true.
This code sets 5 mins for forms, stores and ajax proxies calls within MVC application.
Code snippet:
Ext.Ajax.timeout= 300000; // 300 seconds (5 mins)
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 });
// If you are using Ext.define in your code. It creates new class and does not override timeout property in base class.Hence use above code snippet.
Ext.define('Test.data.Connection', {
override: 'Ext.data.Connection',
timeout: 120000
});
Comments
Post a Comment