PDA

View Full Version : Ajax request timeout?



eyp
26 Nov 2007, 6:55 AM
Hi all,

in a project I'm working on, I have a big problem with GridPanel. I've been using this code to create the datastore,

var ds = new Ext.data.Store( {
proxy: new Ext.data.HttpProxy( {
url: getURL_PAGES()
}),
reader: transJSONReader,
remoteSort: true
});

but sometimes the process who retrieve the data is lasting more than 30s, then the grid didn't fill out, so I've added the timeout attribute in the HttpProxy constructor:

var ds = new Ext.data.Store( {
proxy: new Ext.data.HttpProxy( {
url: getURL_PAGES(),
timeout: 1000000
}),
reader: transJSONReader,
remoteSort: true
});

but I still have the same problem. How could I solve it?, any ideas?

eyp
26 Nov 2007, 7:00 AM
Should be it conn: {timeout: 1000000} instead of timeout: 1000000?

efege
26 Nov 2007, 7:13 AM
Ext.Ajax.timeout = <number of milliseconds>;


See: http://extjs.com/deploy/dev/docs/?class=Ext.Ajax

Note that using the code above affects the global Ext.Ajax connection for every subsequent request.

eyp
26 Nov 2007, 7:23 AM
Excuse me, but how that line fit into the HttpProxy initilization?

efege
26 Nov 2007, 7:27 AM
No, that's a stand-alone line. You may put it e.g. at the beginning of your app's code (as a global initialization setting), or wherever you prefer, provided that it's executed before firing your Ajax requests.

eyp
26 Nov 2007, 7:33 AM
Thank oyu so much Fernando, it works fine! :)