Search code examples
jquerydynatree

How to use jquery dynatree plugin as accordion menu?


I am using dynatree as a tree menu in my project. When the user expand a node i want the previous expanded node to collapse (like an accordion menu).

I think that i have to collapse it in the onExpand event of dynatree. But i dont know how.

Thx in advance.


Solution

  • Add this to your tree definition:

    autoCollapse: true,
    

    From the documentation: Automatically collapse all siblings, when a node is expanded.