Results 1 to 8 of 8

Thread: AJAX global default timeout

  1. #1
    Ext JS Premium Member
    Join Date
    Aug 2011
    Posts
    26

    Default AJAX global default timeout

    Hello All

    I can't seem to overwrite the global ajax timeout of 30 seconds.
    If I try to update the timeout globally to 45 seconds, it still times out after 30 seconds.

    Ext.Ajax.timeout = 45000;

    If I set timeout on ajax proxy on data store to 45 seconds it works. What am I don't wrong? I want to change timeout globally instead of setting it on every datastore.

    Ext.create('Ext.data.Store', {
    ....
    proxy: {
    type: 'ajax',
    timeout: 45000,
    ...
    }

    I should also add that I am using extjs 4.

    Thank you for your help.

  2. #2
    Sencha User
    Join Date
    Jun 2010
    Location
    Gandhinagar, Gujarat, India
    Posts
    29

    Default

    I had done that like this in Ext 3, Ext override doesn't seem to be changed in Ext 4 so this should work.

    Connection class is base of all ajax requests so it will extend time for any kind of ajax request.


    Code:
    Ext.override(Ext.data.Connection, {
            timeout:45000
    }

  3. #3
    Sencha User nickbretz's Avatar
    Join Date
    Jul 2011
    Location
    Kansas City, MO
    Posts
    12

    Default

    When using an Ajax Proxy, rather than just an Ajax Request, you will need to do:

    Code:
    Ext.override(Ext.data.proxy.Ajax, { timeout:60000 });

  4. #4
    Ext JS Premium Member
    Join Date
    Aug 2011
    Posts
    26

    Default

    Thank you very much. This did the trick.

  5. #5
    Sencha Premium Member
    Join Date
    Jun 2011
    Location
    Hartford, CT
    Posts
    21

    Question

    Quote Originally Posted by [email protected] View Post
    Thank you very much. This did the trick.
    Which snippet of code 'did the trick'?

  6. #6
    Sencha Premium Member
    Join Date
    Jun 2011
    Location
    Hartford, CT
    Posts
    21

    Default

    Quote Originally Posted by kanny View Post
    I had done that like this in Ext 3, Ext override doesn't seem to be changed in Ext 4 so this should work.

    Connection class is base of all ajax requests so it will extend time for any kind of ajax request.


    Code:
    Ext.override(Ext.data.Connection, {
            timeout:45000
    }
    Syntax error in the above...
    Code:
    Ext.override(Ext.data.Connection, {
            timeout:45000
    });

  7. #7
    Sencha Premium Member
    Join Date
    May 2010
    Location
    Guatemala, Central America
    Posts
    1,519

    Default

    If you are using ExtJS 4.x there is no need to do an override, Ext.Ajax is singleton so the only thing you have to do is:

    Ext.Ajax.timeout = 45000;
    UI: Sencha Architect / ExtJS 4 - 6
    Server side: JEE / EJB 3.x / CDI / JPA 2.x/ JAX-RS / JasperReports
    Application Server: WildFly / Weblogic
    Databases: Oracle
    / MySQL / DB2 / Firebird

    If you like my answer please vote!

  8. #8
    Ext JS Premium Member
    Join Date
    Mar 2010
    Location
    Northern Virginia
    Posts
    61

    Default

    Check out this related post in the forums.

    http://www.sencha.com/forum/showthre...l=1#post759207

    It covers all of the timeout settings.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •