Recently, I am using EXtjs to make a project. When the loading data is particularly large, the loading timeout will occur. Check it under FB. It turns out that the ext default ajax request is 30 seconds.
I searched the following solutions online for reference and for other people's reference.
When ExtJS makes Ajax requests, the default corresponding time is 30 seconds. If the data query time exceeds 30 seconds, ExtJS will report an error.
This requires modifying the timeout of ExtJS:
2 methods:
1: Add: (timeout: 100000000) attribute when requesting Ajax
The code copy is as follows:
Ext.Ajax.request({
url: 'foo.php',
success: someFn,
failure: otherFn,
timeout: 100000000,//default 30000 million seconds
headers: {
'my-header': 'foo'
},
params: { foo: 'bar'}
});
Ext.Ajax.request({ url: 'foo.php', success: someFn, failure: otherFn, timeout: 100000000,//default 30000 millions headers: { 'my-header': 'f oo' }, params: { foo : 'bar' } });
2: Add: Ext.Ajax.timeout = 180000 at the beginning of js;
The code copy 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 ;// Report type test Later, it was found that the first setting was invalid and the second setting was valid.
Because of being too busy, I will test it here first. I think the most important thing to do is to optimize the database. After all, it is definitely unacceptable to make a query and let the user wait for 3 minutes. Unacceptable for 1 minute.