This is a migrated thread and some comments may be shown as answers.

On single click of Button Expand KendoUI TreeView in Jquery - Its not repatitive question?

1 Answer 73 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
TaylorBrown
Top achievements
Rank 1
TaylorBrown asked on 29 Nov 2020, 04:10 PM
Dear All,
I  am new to Kendo control, please help me with this, I already have Tree View as shown in the attachment, Now I have Expand onclick of button, I know the code to perform Expand, but it doesn't expand complete child nodes, instead it does just only 1 immediate child, if it has more child, we need to keep clicking the Expand button then it does the expand. Please help me how to achive on single click to Expand all the Parent and Child nodes.


Its not repatitive question, I have already searched here,Please help me.

This is My code:   
                  $("#expand").on("click", function(){
                    var treeview = $("#treeview").data("kendoTreeView");
                              treeview.expand(".k-item");
                    })

 

1 Answer, 1 is accepted

Sort by
0
Neli
Telerik team
answered on 01 Dec 2020, 01:56 PM

Hi TaylorBrown,

From the second email, it seems you have found a solution to the issue. However, as it could be helpful to someone else who has the same issue here is a Dojo example where the nodes in the TreeView are expanded on initialization. In the example, in the dataBound event handler, the "k-item" class is used to expand all nodes of the TreeView.

dataBound: function(e){
       	 e.sender.expand(".k-item");
  },

I hope the above will help.

Regards,
Neli
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Data Source
Asked by
TaylorBrown
Top achievements
Rank 1
Answers by
Neli
Telerik team
Share this question
or