More in this section

Forums / Developing with Sitefinity / 6.1 kendo treeview functionality (wihtout + - to colllaps expand)

6.1 kendo treeview functionality (wihtout + - to colllaps expand)

3 posts, 0 answered
  1. Markus
    Markus avatar
    2763 posts
    25 Nov 2005
    21 Aug 2013
    Link to this post
    After trying kendo panelbar support told me to switch back to treeview.

    But I am strugeling with the widget template.

    a) of course I don't want all nodes expandes so I commented this line out
    // kendoTreeView.expand(kendoTreeView.element.find(".k-item"));

    b) of course once a page is selected I want the node for this pages expanded. This code thanks to Telerik does the trick.

    var selectedNodesToExpand = kendoTreeView.element.find("li:has(li a.sfSel)");

    This link shows it:

    c) The client does not want an open (+) close (-) image to expand/collaps the trees. So this is what I need.

    Look at his page:

    This is a group page and it will redirect to the first 'real' page 'Ubersicht' and therefore expand the sibling nodes since the script from b) comes into actions


    Look at this page:

    This is a real page. So when the user clicks 'Ihre Anforderungen' from the 1st Level in the navigation, the page is loaded and b) kicks in.

    but -> I now want of course  the child nodes expanded as well.


    The first level pages are an overview for what is to come under that menu item.

    The way that works:

    Einsatzgebiete is an group page
    Ubersicht is a real page and shown in Navigation

    The way that does not work:
    Ihre Anforderung is real page
    No child nodes will be shown when page is loaded

    Einsatzgebiet is a group page
    Uebersicht is real page but not shown in navigation.

    Long problem short.

    I guess I need a jquery way to find the selected node and if it has child items expand them.

  2. Patrick Dunn
    Patrick Dunn avatar
    237 posts
    03 Nov 2014
    23 Aug 2013
    Link to this post

     For the betterment of the community I am going to post the solution we found in your support ticket here.

    <script type="text/javascript">
        (function($) {
            varkendoTreeView = $('.sfNavTreeview').not('div.k-treeview .sfNavTreeview').kendoTreeView({
                animation: false
          // to expand all nodes uncomment next line
          // kendoTreeView.expand(kendoTreeView.element.find(".k-item"));
          // to expand selected node uncomment next line    

    Patrick Dunn
    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 Public Issue Tracking system and vote to affect the priority of the items
  3. Markus
    Markus avatar
    2763 posts
    25 Nov 2005
    23 Aug 2013 in reply to Patrick Dunn
    Link to this post
    Dear Patrick

    Thank's. I did post it in my panelbar first time user thread but forgot about this.

    If you now add it to the template for 6.2 then nobody has to look here :-)

    Once again thanks for the easy, obvious solution.

3 posts, 0 answered