Results 1 to 3 of 3

Thread: Function provided to Ext.onReady continually called when `withDomReady` arg === true

    Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Ext JS Premium Member Gjslick's Avatar
    Join Date
    Feb 2009
    Location
    NJ, USA
    Posts
    129

    Default Function provided to Ext.onReady continually called when `withDomReady` arg === true

    Ext version tested:
    • Ext 4.1 rev 1
    Browser versions tested against:
    • Chrome 21
    • IE 8
    • FF 14 (firebug 1.10.2 installed)
    Description:
    • Function provided to Ext.onReady() is continually called when `withDomReady` argument is provided as true. Basically causes the browser to freeze. Noticed this problem start to happen when we switched from using version 4.0.2 to 4.1.0
    Steps to reproduce the problem:
    • Go to jsfiddle.net
    • On the left, select "no wrap (head)" and "ExtJS 4.1.1" in the dropdowns
    • Put this code into the JavaScript section:
      Code:
      Ext.onReady( function() {
          console.log( "hello there" );
      }, window, /* withDomReady */ true );
    • Hit the "Run" button on the top.
    • Observe thousands upon thousands of console logs, and/or frozen browser (recommend Chrome if you don't want the frozen browser scenario.)
    The result that was expected:
    • The function provided to Ext.onReady() should have been called only once.
    The result that occurs instead:
    • The function provided to Ext.onReady() is called over and over, never stopping.
    Possible fix:
    • not provided
    Operating System:
    • Win7

  2. #2
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,892

    Default

    Well, that's the "options" argument. Not sure why true would break it.

    It's supposed to be an object.

  3. #3
    Ext JS Premium Member Gjslick's Avatar
    Join Date
    Feb 2009
    Location
    NJ, USA
    Posts
    129

    Default

    Ah, so the docs for Ext.onReady() don't specify its arguments. It just says that the method is an alias for Ext.Loader.onReady(), "with withDomReady set to true."

    So it seems that some of developers I work with thought that the 3rd argument was still the `withDomReady` argument (from its alias), and used that throughout our 4.0 code. Then the upgrade to 4.1 caused the "browser freezing" issue we're experiencing. Could you guys document the Ext.onReady() method to say that it accepts just the three args (fn, scope, options), so that this doesn't happen again?

    Very weird that the callback function would continually be called when `options` === true though... Wish I had the time to dissect the cause of that one!

    All the best.
    -Greg

Posting Permissions

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