Try Now
More in this section

Forums / Designing & Styling / Vertical Navigation(Tree View)

Vertical Navigation(Tree View)

2 posts, 0 answered
  1. Nagesh
    Nagesh avatar
    9 posts
    01 Jul 2014
    01 Jul 2014
    Link to this post

    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. 

  2. Svetoslav Manchev
    Svetoslav Manchev avatar
    735 posts
    17 Oct 2016
    02 Jul 2014
    Link to this post
    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

    <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) {
                    sibling = sibling.nextElementSibling;                
                  sibling = clicked.previousElementSibling;
                  while (sibling) {
                    sibling = sibling.previousElementSibling;                

    Svetoslav Manchev
    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
2 posts, 0 answered