Results 1 to 4 of 4

Thread: Event Raised For Connection Timeout

  1. #1

    Default Event Raised For Connection Timeout

    What event is raised when an Ext.data.Connection times out? I tried catching this in the loadexception of my Ext.data.HttpProxy class, but this never fires.

    I noticed there is an Extension/Plugin out there for Extending AJAX functionality. Is that the only way to handle timeouts?

    Thanks!

  2. #2
    Sencha User
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364

    Default

    Have you tried this?
    Code:
    requestexception : ( Connection conn, Object response, Object options )
    
    Fires if an error HTTP status was returned from the server. See HTTP Status Code Definitions for details of HTTP status codes.
    Listeners will be called with the following arguments:
    
        * conn : Connection
          This Connection object.
        * response : Object
          The XHR object containing the response data. See The XMLHttpRequest Object for details.
        * options : Object
          The options config object passed to the request method

  3. #3

    Default

    Hi,

    I've not tried that method. Does it matter whether I use the Ext.Ajax or the Ext.data.Connection implementation of requestexception()?

    Thanks!

  4. #4

    Default

    Forgot to post that this was resolved using jgarcia's advice.

    The requestexception exception handler on the Connection will detect timeouts and other HTTP error responses:
    PHP Code:
    [left]var conn = new Ext.data.Connection({
    url'/some/glorious/path.do',
    timeout45000,
    listeners: {
    'requestexception': {
    fn: function(objresponseoptions) {
    loadCount++; // an error occurred - could be a timeout
    }

    },
    scopethis
    }
    }[/
    left]
    }); 
    The loadexception in the Store will detect if the store did not load properly with the data that was returned:
    PHP Code:
    [left]var store = new Ext.data.Store({ 
    proxy: new Ext.data.HttpProxy(dailyConn),
    readerjsonReader,
    listeners: {
    'loadexception': {
    fn: function() { 
    loadCount++; // an error occurred while loading the store with data
    }

    },
    scopethis
    }
    }
    }); [/
    left
    Which, in hindsight, makes perfect sense..

Posting Permissions

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