Extjs sets the Ajax request timeout -- timeout attribute

Source: Internet
Author: User

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.

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;

Ext. onready (function () {Ext. blank_image_url = '.. /.. /common/ext3/resources/images/default/s.gif '; Ext. ajax. timeout = 180000; var datetype; // Report Type

After the test, the first and second settings are invalid.

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.

PS: software developers are responsible for and themselves from the customer's perspective.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.