Recently, EXtjs was used as a project. When loading a large amount of data, loading times out. In FB, it turns out that ext's default ajax request is 30 seconds.
Find the following solution on the Internet for your reference and other people's reference.
When ExtJS makes an Ajax request, the default time is 30 seconds. If the data query time exceeds 30 seconds, ExtJS reports an error.
In this case, you need to modify the ExtJS timeout time:
Two methods:
1: add the :( timeout: 100000000) attribute during Ajax requests.
Copy codeThe Code is as follows:
Ext. Ajax. request ({
Url: 'foo. php ',
Success: someFn,
Failure: otherFn,
Timeout: 100000000, // default 30000 milliseconds
Headers :{
'My-header': 'foo'
},
Params: {foo: 'bar '}
});
Ext. ajax. request ({url: 'foo. php ', success: someFn, failure: otherFn, timeout: 100000000, // default 30000 milliseconds headers: {'my-head': 'foo'}, params: {foo: 'bar '}});
2: Add Ext. Ajax. timeout = 180000 at the beginning of js;
Copy codeThe Code is as follows:
Ext. onReady (function (){
Ext. BLANK_IMAGE_URL = '.../common/ext3/resources/images/default/s.gif ';
Ext. Ajax. timeout = 180000;
VardateType; // Report Type
Ext. onReady (function () {Ext. BLANK_IMAGE_URL = '.. /.. /common/ext3/resources/images/default/s.gif '; Ext. ajax. timeout = 180000; var dateType; // after the report type test, the first setting is invalid, and the second setting is valid.
If the relationship is too busy, we can test it first. I think the most important thing to do is to optimize the database. After all, it is unacceptable to make a query so that users can wait for three minutes. 1 minute is unacceptable.