Any way to set focus to a tree node programmatically?
Printable View
Any way to set focus to a tree node programmatically?
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:
To just scroll to the element in question:Code:TreeNode<MyModel> node = tree.findElement(someModelObject);
Element elt = tree.getView().getTextElement(node);
//do something with elt
To select it:Code:tree.scrollIntoView(someModelObject);
Code:tree.getSelectionModel().select(someModelObject, false);
Got it! Thank you. I kept diving into "focus" methods