2

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!

Paul
  • 3,812
  • 10
  • 50
  • 73

1 Answers1

2

You can use one of the selectRecord methods.

grid.selectRecord(record);
Mia Clarke
  • 8,134
  • 3
  • 49
  • 62
  • I saw that you know a lot of things related to smartgwt, therefore, with all my repect, I please you look on another issue of mine from here: http://stackoverflow.com/questions/4967266/tree-dragdrop-nodes-refresh Thank you so much. – Paul Feb 11 '11 at 09:17