1. #1
    Ext JS Premium Member
    Join Date
    Aug 2011
    Posts
    19
    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
    Posts
    11
    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
    2
    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
    19
    Vote Rating
    0
    kshatalov@citco.com is on a distinguished road

      0  

    Default


    Thank you very much. This did the trick.

Tags for this Thread