Reputation: 33
I am trying to avoid the Timeout parameter while perform an Ajax request.
On the application I have a "Send button" in which I send the information to the Server as:
if (Ext.getCmp('bottomPanel').getForm().isValid()) {
mask.show();
Ext.Ajax.request({
url: 'sendInfo.do',
timeout: 30000,
jsonData: {
'businesDateString': businessDate,
'incremental': incremental
},
success: doDwrCallbackForced, //edit: used for Ext.MessageBox.show(message)
failure: failureCallBack //edit: used for Ext.MessageBox.show(error message)
});
But this process could take between 2 mins to 15/20 mins. And I want to call the method of the server only once.
Is there any way to avoid the timeout (apart from timeout:1800000, - 30 mins- , in the Ajax.request call)?
Can the TaskRunner object be useful for this task?
Thanks in advance
Upvotes: 1
Views: 2340
Reputation: 182
You could override the timeout settings globally...
Without giving the reason for not using the timeout config on the ajax.request function, it is tough to give you a proper answer.
Ext.Ajax.timeout = 300000; // 300 seconds
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 });
Upvotes: 1