Reputation: 63
I try to select the next leaf node of that currently selected.
For example:
The leaf2 is currently selected. When I click on a button how to unselect this node and select the next node (in this example the next node is leaf3)?
Upvotes: 1
Views: 529
Reputation: 144
After getting a reference to the node that is to be removed, use the nextSibling
property to get a reference to the next node, and select it.
Something like this:
var node = treePanel.getSelectionModel().getSelection()[0];
var nextNode = node.nextSibling;
if (nextNode) treePanel.getSelectionModel().select(nextNode);
Working Fiddle
Upvotes: 2