Vertical Navigation(Tree View)

Posted by Community Admin on 05-Aug-2018 09:11

Vertical Navigation(Tree View)

All Replies

Posted by Community Admin on 01-Jul-2014 00:00

Hi., I am using vertical navigation with sub levels widget template and I selected custom pages for navigation and included in page template. I am getting top level pages as well as child pages. I want only top level navigation child pages needs to collapse default when ever we click on top level page the child pages needs to be expanded. 

Any suggestions thanks in advance. 

Posted by Community Admin on 02-Jul-2014 00:00

Hi Nagesh,

If I correctly understand your need, below is the code snippet that you can use in order to keep open only the node where the subpage is open. Short video demonstration how it works is available
here.

<script type="text/javascript">
    (function ($)
        var kendoTreeView = $('.sfNavTreeview').not('div.k-treeview .sfNavTreeview').kendoTreeView(
            animation: false,
            expand: function(e)
              var clicked = e.node;
                
              var sibling = clicked.nextElementSibling;             
              while (sibling)
                kendoTreeView.collapse(sibling);
                  
                sibling = sibling.nextElementSibling;                
                          
                
              sibling = clicked.previousElementSibling;
              while (sibling)
                kendoTreeView.collapse(sibling);
                  
                sibling = sibling.previousElementSibling;                
                 
            
        ).data('kendoTreeView');
      //kendoTreeView.expand(kendoTreeView.element.find(".k-item"));
    )(jQuery); 
</script>

Regards,
Svetoslav Manchev
Telerik
 
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

This thread is closed