7 Nov 2011 11:35 AM #1
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?
10 Nov 2011 11:26 PM #2
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.
10 Nov 2011 11:28 PM #3
11 Nov 2011 10:28 AM #4
Excellent, thanks for clearing up the mystery!
23 Nov 2011 11:12 AM #5
- Join Date
- Mar 2007
- Notts/Redwood City
- Vote Rating
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.Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
23 Nov 2011 11:17 AM #6
Very cool, thanks Animal! That certainly makes things easier all-around.
7 Jul 2013 5:54 PM #7
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?
12 Dec 2013 7:42 AM #8