1. #1
    Sencha User
    Join Date
    May 2011
    Location
    UK
    Posts
    14
    Vote Rating
    0
    fetimo is on a distinguished road

      0  

    Default Focusing on an Element

    Focusing on an Element


    Hi all,

    I'm trying to focus on an element when a key is pressed, I'm using the FocusManager so theoretically it should be simple, right?

    The key pressing part isn't an issue, that works fine, but there doesn't seem to be any way to focus on a specific element.

    Things I've tried:

    Code:
    eastPanel.focus();	    	    
    Ext.FocusManager.setFocus(eastPanel, true, Ext.FocusManager.options);  
    Ext.FocusManager.navigateSiblings();
    Ext.FocusManager.focusEl(eastPanel);	    	
    Ext.FocusManager.shouldShowFocusFrame(true);	    	
    Ext.FocusManager.setFocus(eastPanel);
    Has anyone successfully accomplished this before? I've exhausted things that I can think of to try.

  2. #2
    Sencha User
    Join Date
    May 2011
    Location
    UK
    Posts
    14
    Vote Rating
    0
    fetimo is on a distinguished road

      0  

    Default


    I fixed it by doing:

    Code:
     eastPanel.el.focus();
    I was trying to focus on the JavaScript object rather than the node in the DOM.