TreeView not expanding Programmatically

2 posts, 0 answers
  1. Daochuen
    Daochuen avatar
    38 posts
    Member since:
    Sep 2017

    Posted 28 Dec 2018 Link to this post

    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

     

     

  2. Daochuen
    Daochuen avatar
    38 posts
    Member since:
    Sep 2017

    Posted 28 Dec 2018 in reply to Daochuen Link to this post

    I find out the reason:

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

    treeView.expand(e.node);

Back to Top