I have a tree in which i want the onOpen and onClose to be called only when the user clicks on the +/- icon and not if he clicks anywhere on the line that contains the folder. then I want the onClick event fired whenever the user clicks on the line where the folder is(except for on the expand/collapse icon). I have tried looking at the node passed to the onopen by default and also have tried looking at the node sent by the onclick. It seems that onopen ovverides onclick internally. Please give me a direction to approach this issue.
Thanks in Advance!
Looks like there is a flag you can pass to the Tree to do this:
// openOnClick: Boolean
// If true, clicking a folder node's label will open it, rather than calling onClick()
openOnClick: false,
You would use it like this:
var myTree = new Tree({
..., //the other arguments you are already using
openOnClick: true
});
In the future, I recommend checking the API docs or the source code for the widgets you are using. You will find that you will often stumble across useful features like this and that the Dojo source code is well organized and easy to read so its a good place to check whenever you have a doubt about how something works.