3 Answers, 1 is accepted
Hi Ewgenij,
The nodeTemplate directive can be used for the purpose. It exposes an index property which is unique for each node item. The index can be added to the each node in the templated in the following way:
<kendo-treeview
[nodes]="data"
kendoTreeViewExpandable
kendoTreeViewHierarchyBinding
childrenField="items">
<ng-template kendoTreeViewNodeTemplate let-dataItem let-index="index">
<span [id]="index"> {{ dataItem.text }}</span>
</ng-template>
</kendo-treeview>
I hope this helps. Also, please expect a representative from our sales team to contact you regarding your license.
Regards,
Svetlin
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.
Hi Ewgenij,
Indeed, there isn't such built-in feature that would allow to achieve the requirement. Instead what could be done is to use some custom recursive logic in order to iterate the items. That approach will allow to create and store the stable indexes in an item property as per the use - case scenario.
Regards,
Svetlin
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.