Using GXT 2 M3 (TreePanel)
I have a simple click listener set for the TreePanel (because I want to have the treenode expand on single-click but not vice-versa unless the ARROW to the left is clicked).
In the listener I check if the node is expanded and then do the stuff required as follows :
Code:
// This is how I set the listener on the tree panel
tree.addListener(Events.OnClick, new TreeClickListener());
// The Listener class
public class TreeClickListener implements Listener<TreePanelEvent<GenericTreeModel>>{
@Override
public void handleEvent(TreePanelEvent<GenericTreeModel> be) {
TreeNode node = be.getNode();
GenericTreeModel model = (GenericTreeModel) be.getItem();
if(be.getType() == Events.OnClick){
if(node.isExpanded()){
if(!be.getTargetEl().getStyleName().equals("x-tree3-node-text"))
node.setExpanded(false);
}else{
node.setExpanded(true);
}
}
}
}
Now when a node is expanded and I click on a node's text the node.isExpanded() returns true (checking it in the listener), but when I click the arrow to the left, it returns false !!!
Wonder if this is a bug ?