Skip to content Skip to sidebar Skip to footer

Dojo Tree Event On Root Nodes

**I'm building dojo tree using the following code: The tree is displayed as expected. The problem that I have is that the onClick event is only fired on leaf nodes. When I click o

Solution 1:

You've got openOnClick set to true for your tree. I think the API docs answer this as well as I possibly could.

http://dojotoolkit.org/api/dijit/Tree/openOnClick

That said, it looks like you'd be able to connect to _onClick instead and do whatever you want (that's the method responsible for calling onClick only when openOnClick is false, anyway). Or, if you wanted to feel a little less guilty about accessing private members, dojo.declare yourself a subclass of dijit.Tree, extending _onClick to also fire another function you define as public.

Post a Comment for "Dojo Tree Event On Root Nodes"