Smartgwt select treenode from code

2.3k views Asked by At

I have a TreeGrid in which I have a Tree:

Tree nodesTree = new Tree();
TreeGrid navTreeGrid = new TreeGrid(); 
navTreeGrid.setData(nodesTree);

and I want everytime I'm adding a node to the tree to get focus on it.

More general, how can I from code to select a TreeNode in a Tree?

I know it is navTreeGrid.getSelectedRecord() method but is not what I want.

Thank you!

1

There are 1 answers

1
Mia Clarke On BEST ANSWER

You can use one of the selectRecord methods.

grid.selectRecord(record);