PDA

View Full Version : how to set timeout in api actions for a HttpProxy



flamant
1 Mar 2011, 5:48 AM
Hi,
I try to set a timeout parameter on read/create/update/delete actions of the HttpProxy api parameter this way :



var remoteGridProxy = new Ext.data.HttpProxy({
api:{
read: { url: '../secure/getSubjectDataGrid.htm', method: 'GET', timeout: 240000 },
create: { url: '../secure/createSubjectDataGrid.htm', method: 'POST', timeout: 240000 },
update: { url: '../secure/updateSubjectDataGrid.htm', method: 'POST', timeout: 240000 },
destroy: { url: '../secure/deleteSubjectDataGrid.htm', method: 'POST', timeout: 240000 }
}
});


But it doesn't work
According to the documentation they say that

Alternatively, one can use the object-form to specify each API-action

I wonder what is "object-form". Anyway I am sure that we can specify "url" and "method" and
I checked that in each EXTJS object that has "method" parameter we can specify timeout parameter

Thank you in advance for your answers

flamant
12 Mar 2011, 6:41 AM
I haven't found a solution, I relaunch the thread

D@nte
17 Mar 2011, 8:19 PM
This one may be a solution



var remoteGridProxy = new Ext.data.HttpProxy({
api:{
read: { url: '../secure/getSubjectDataGrid.htm', method: 'GET'},
create: { url: '../secure/createSubjectDataGrid.htm', method: 'POST'},
update: { url: '../secure/updateSubjectDataGrid.htm', method: 'POST'},
destroy: { url: '../secure/deleteSubjectDataGrid.htm', method: 'POST'}
}
});





remoteGridProxy.getConnection().timeout = 240000;

flamant
20 Mar 2011, 10:18 AM
Hi D@nte, and thank you for your answer
actually it works