1. #1
    Ext JS Premium Member burnnat's Avatar
    Join Date
    Jun 2011
    Posts
    418
    Vote Rating
    61
    burnnat is a jewel in the rough burnnat is a jewel in the rough burnnat is a jewel in the rough burnnat is a jewel in the rough

      0  

    Default Where is Ext.FocusManager.subscribe()?

    Where is Ext.FocusManager.subscribe()?


    Looks to me like Ext.FocusManager.subscribe() and .unsubscribe() have mysteriously disappeared in 4.1, though references to them still exist in the class-level documentation for FocusManager. Is this intentional? If so, is there a suitable alternative to use instead?

  2. #2
    Sencha - Ext JS Dev Team dongryphon's Avatar
    Join Date
    Jul 2009
    Posts
    1,367
    Vote Rating
    136
    dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold

      0  

    Default


    Thanks! This was unintentional - an artifact of accessibility work that we had started and de-scoped from 4.1. We need to restore FocusManager to its 4.0 state before we ship 4.1.
    Don Griffin
    Ext JS Development Team Lead

    Check the docs. Learn how to (properly) report a framework issue and a Sencha Cmd issue

    "Use the source, Luke!"

  3. #3
    Sencha - Ext JS Dev Team dongryphon's Avatar
    Join Date
    Jul 2009
    Posts
    1,367
    Vote Rating
    136
    dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold

      0  

    Default


    This ticket is EXTJSIV-4445
    Don Griffin
    Ext JS Development Team Lead

    Check the docs. Learn how to (properly) report a framework issue and a Sencha Cmd issue

    "Use the source, Luke!"

  4. #4
    Ext JS Premium Member burnnat's Avatar
    Join Date
    Jun 2011
    Posts
    418
    Vote Rating
    61
    burnnat is a jewel in the rough burnnat is a jewel in the rough burnnat is a jewel in the rough burnnat is a jewel in the rough

      0  

    Default


    Excellent, thanks for clearing up the mystery!

  5. #5
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,508
    Vote Rating
    56
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      1  

    Default


    subscribe is no longer required.

    FocusManager used to have to be "pointed at" a Container (subscribed to the Container), and it would dig out all descendant Components and add listeners to both the descendant's element and the descendant Component itself.

    And it also then had to monitor for adds and removes within that Container tree.

    Not that efficient.

    Now, AbstractComponent's onFocus and onBlur template methods are called on focus and blur of the Component's getFocusEl(). This is part of the natural functionality of Components. Non-focusable Components won't implement getFocusEl, and so will not be part of the focus tree. Containers are focusable so that you can navigate between and into them.

    So now, FocusManager hooks directly into AbstractComponent's template methods and sees what is being focused.

    So once it's enabled it globally tracks focus, and adds framing which follows focus, and allows navigation into the Container->Component tree.

  6. #6
    Ext JS Premium Member burnnat's Avatar
    Join Date
    Jun 2011
    Posts
    418
    Vote Rating
    61
    burnnat is a jewel in the rough burnnat is a jewel in the rough burnnat is a jewel in the rough burnnat is a jewel in the rough

      0  

    Default


    Very cool, thanks Animal! That certainly makes things easier all-around.

  7. #7
    Sencha Premium Member
    Join Date
    Apr 2011
    Posts
    14
    Vote Rating
    1
    masood is on a distinguished road

      0  

    Default When should you call Ext.FocusManager.enable() ?

    When should you call Ext.FocusManager.enable() ?


    So if we are to use a non focus-able component in a window does this mean that Ext.FocusManager.enable() has to be called in the initComponent and disable() in the destroy?
    Is there a performance hit if it turned on for the entire application?

  8. #8
    Sencha User
    Join Date
    Mar 2009
    Posts
    1
    Vote Rating
    0
    wucalv is on a distinguished road

      0  

    Default


    You can enable it in app.js - launch.