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

Make last child node as anchor tag for all the parent nodes

1 Answer 80 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Yatish
Top achievements
Rank 1
Yatish asked on 02 Jun 2016, 04:58 PM

Hi,

I am working with the treeview with angularjs template shown on the telerik treeview demo and looking for the following format.

A

   1

      1.1

   2

      2.1

            2.1.1

Is there a way to make only the '1.1' and '2.1.1' (the last child nodes on the respective parents)as anchor tags. I tried to use the k-template and define anchor tag on the template and it is causing all the nodes render as anchor tags.

-YK

     

1 Answer, 1 is accepted

Sort by
0
Accepted
Daniel
Telerik team
answered on 06 Jun 2016, 06:33 AM
Hello,

I replied to the support ticket. For convenience I am pasting my reply below:


Should all leaf nodes be made anchors or just the last leaf node? It is not clear from the example. In the first case you can use the hasChildren field (and if needed the level method to determine) if the node is leaf. In case you need to make only the last leaf then you should also check the index of the item in the parent data. I created an example that demonstrates both cases.

Regards,
Daniel
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
Yatish
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or