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

TreeView not expanding Programmatically

1 Answer 314 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Daochuen
Top achievements
Rank 1
Iron
Veteran
Iron
Daochuen asked on 28 Dec 2018, 06:52 PM

Hi

I have issue with Kendo treeview expanding in my MVC project. I try to expand treeview node (which have children nodes) at same time when I select it. The code went through in .js file without error.  but node didn't expand. Could any one tell me what properly be wrong? below are piece of code.  Thanks.

 

        var selectedNode = $("#treeView").data('kendoTreeView').dataItem(e.node); // selectedNode have correct data after this.
        var treeView = $("#treeView").data('kendoTreeView');
        treeView .expand(selectedNode); //Code went through without error

 

 

1 Answer, 1 is accepted

Sort by
0
Daochuen
Top achievements
Rank 1
Iron
Veteran
Iron
answered on 28 Dec 2018, 08:55 PM

I find out the reason:

expand() required real node as parameter. below code was working.

treeView.expand(e.node);

Tags
TreeView
Asked by
Daochuen
Top achievements
Rank 1
Iron
Veteran
Iron
Answers by
Daochuen
Top achievements
Rank 1
Iron
Veteran
Iron
Share this question
or