I am currently working on a project using EXtjs. When the amount of data loaded is particularly large, a loading timeout will occur. Checking it under FB, it turns out that ext’s default ajax request is 30 seconds.
Search the following solutions on the Internet for reference and reference by others.
When ExtJS makes an Ajax request, the default response time is 30 seconds. If the subsequent 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
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-header': 'foo' }, params: { foo: 'bar' } });
2: Add: Ext.Ajax.timeout at the beginning of js = 180000;
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 After testing, it was found that the first setting was invalid, but the second setting was effective.
I was too busy, so I tested it here first. I felt that the best thing to do was to optimize the database. After all, make a query. , asking users to wait for 3 minutes is definitely unacceptable for even 1 minute.