I need the selected node to expand on single click if the node has children. I tried using the toggle() method on the selected node during the dropdowntree change event but have been unable to produce the desired result.
For your health,
Chad
2 Answers, 1 is accepted
0
Accepted
Tsvetomir
Telerik team
answered on 06 Sep 2018, 03:41 PM
Hi Chad,
You can access the TreeView of the DropDownTree and use the events and methods it provides. More information on how to access it you can find here: treeview. After accessing the treeview, you can add the expand event. In the event handler check if the node is expanded, if not call the expand() method to the closest node that is not expanded. You can find more insight on the method here: expand() method.
Another possible approach would be to use the expandTo() method and as an input argument pass the node until which you would like to expand.
I also created a sample Dojo project to demonstrate how the aforementioned suggestions could be implemented: http://dojo.telerik.com/EQIYEViT.
Please give it a try and see if it works as expected on your side as well.
Kind regards,
Tsvetomir
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers.Learn More.