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

Breadcrumbs to selected node

6 Answers 616 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Richard
Top achievements
Rank 1
Richard asked on 21 Feb 2012, 06:52 PM
How would I go about constructing a string value for the drillpath to the current node?

In breadcrumb form it might look like this:
  level-1-node-text > level-2-node-text > level-3-node-text > level-4-selected-node-text
or 
  Tools>Carpentry>Hammer>Lightweight>Stanley

Thanks,
Richard

6 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 22 Feb 2012, 10:09 AM
Hi,

 I created a jsFiddle which shows how to achieve this.

Regards,
Atanas Korchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Richard
Top achievements
Rank 1
answered on 24 Feb 2012, 02:44 PM
Thanks for the quick help.

This also worked for me:

    var node = $(e.node);
    var crumbs = node.find('span.k-in').first().text();
    $.each (node.parents('li'), function (index,value) {
            var nodeText = $(value).find('span.k-in').first().text();
            crumbs = $.trim(nodeText) + " > " + crumbs;
    });

Your solution demonstrates a seasoned jQuery mindset -- one I hope to achieve.
   
0
Christopher
Top achievements
Rank 1
answered on 02 Apr 2012, 04:10 AM
The above code solves the "generating the breadcrumbs" half of the problem.
The selected node will be associated with the last breadcrumb.
The other half is we want to take the children of the selected node and make them be
the new root noded of the tree, replacing all the current "roots" with them.
I'd very much lile to see the code for doing that.
0
Richard
Top achievements
Rank 1
answered on 08 Apr 2012, 08:20 PM
Christopher:

Fiddle http://jsfiddle.net/ycjwB/2/ demonstrates how jquery .detach, .remove, and .append can be used to prune and graft tree parts.  The example has little real world usefulness
0
Jason
Top achievements
Rank 1
answered on 16 Feb 2016, 09:06 PM
Hello Atanas, is it possible to configure this control so that it is a traditional horizontal breadcrumb (like this  home > page1 > page1child ), and not a tree view?
0
Alex Gyoshev
Telerik team
answered on 22 Feb 2016, 07:13 AM

Hello Jason,

The fiddle shows how to show what the selected path in the TreeView is. If you are looking for a traditional breadcrumb component (which allows users to navigate to parent pages), I am afraid that there isn't one in the Kendo UI framework.

Regards,
Alex Gyoshev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
TreeView
Asked by
Richard
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Richard
Top achievements
Rank 1
Christopher
Top achievements
Rank 1
Jason
Top achievements
Rank 1
Alex Gyoshev
Telerik team
Share this question
or