10
votes

Im trying to get the component that is active/focused at a given time. I already know that you can get a HTMLElement with the cross-browser javascript function document.activeElement.

How can I cast this element to a Ext.Component or does ExtJs have a similar function?

2

2 Answers

13
votes

I've figured it out myself :)

var activeComponent = Ext.get(Ext.Element.getActiveElement());

0
votes

Take a look at this : Ext.FocusManager. I have never used this feature, could you tell me if it fits with your needs?