1. #1
    Sencha User
    Join Date
    Dec 2012
    Posts
    9
    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
    Posts
    1,925
    Vote Rating
    55
    Colin Alworth is a jewel in the rough Colin Alworth is a jewel in the rough Colin Alworth is a jewel in the rough

      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
    9
    Vote Rating
    0
    Kathie is on a distinguished road

      0  

    Default


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