1. #1
    Sencha User
    Join Date
    Dec 2012
    Posts
    17
    Vote Rating
    0
    Kathie is on a distinguished road

      0  

    Default Set focus to a tree node

    Set focus to a tree node


    Any way to set focus to a tree node programmatically?

  2. #2
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,731
    Vote Rating
    90
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    What do you mean by focus? Are you trying to edit the cell there? Or select the row?
    To find the element in there (could be useful if doing something with a cell:
    Code:
    TreeNode<MyModel> node = tree.findElement(someModelObject);
    Element elt = tree.getView().getTextElement(node);
    
    //do something with elt
    To just scroll to the element in question:
    Code:
    tree.scrollIntoView(someModelObject);
    To select it:
    Code:
    tree.getSelectionModel().select(someModelObject, false);

  3. #3
    Sencha User
    Join Date
    Dec 2012
    Posts
    17
    Vote Rating
    0
    Kathie is on a distinguished road

      0  

    Default


    Got it! Thank you. I kept diving into "focus" methods

Thread Participants: 1

Tags for this Thread