1. #1
    Ext JS Premium Member
    Join Date
    Aug 2011
    Posts
    24
    Vote Rating
    0
    kshatalov@citco.com is on a distinguished road

      0  

    Default AJAX global default timeout

    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
    17
    Vote Rating
    0
    kanny is on a distinguished road

      0  

    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
    Vote Rating
    3
    nickbretz is on a distinguished road

      1  

    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
    24
    Vote Rating
    0
    kshatalov@citco.com is on a distinguished road

      0  

    Default


    Thank you very much. This did the trick.

  5. #5
    Sencha Premium Member
    Join Date
    Jun 2011
    Location
    Hartford, CT
    Posts
    20
    Vote Rating
    -1
    garberfc is an unknown quantity at this point

      0  

    Question


    Quote Originally Posted by kshatalov@citco.com 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
    20
    Vote Rating
    -1
    garberfc is an unknown quantity at this point

      0  

    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,305
    Vote Rating
    107
    ssamayoa is just really nice ssamayoa is just really nice ssamayoa is just really nice ssamayoa is just really nice

      0  

    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 3.x / ExtJS 4 & 5
    Server side: JEE / EJB 3.x / CDI / JPA 2.x/ JAX-RS / JasperReports
    Application Server: Glassfish / WildFly
    Databases: Oracle / DB2 / MySQL / Firebird

    If you like my answer please vote!

  8. #8
    Ext JS Premium Member
    Join Date
    Mar 2010
    Location
    Northern Virginia
    Posts
    59
    Vote Rating
    4
    aghextjs is on a distinguished road

      0  

    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.