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

Tree data structure

1 Answer 88 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
mark
Top achievements
Rank 1
Veteran
mark asked on 29 Apr 2020, 03:18 PM

What I understand is that the tree data has to ordered before hands in order to show in as a hierarchy. Is that correct? The reason I am asking is because other products can accept unordered data but parent-child ids.

Thanks

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 30 Apr 2020, 03:58 PM

Hello Mark,

The TreeView offers an out-of-the-box solution for local flat data through the kendoTreeViewFlatDataBinding directive. Here's an example. Note that you need to specify the idField and the parentIdField properties for the directive to know which items are related.

Alternatively, you can filter the items yourself. To do so, you will have to implement the children and hasChildren callbacks of the TreeView. Also, the nodes property will have to point to a filtered collection that includes only those data items that should be rendered as root nodes. Here's the article from our docs on data binding and here's an example.

Let me know if further information on the topic is required.

Regards,
Dimitar
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
TreeView
Asked by
mark
Top achievements
Rank 1
Veteran
Answers by
Dimitar
Telerik team
Share this question
or