This is a migrated thread and some comments may be shown as answers.
Specifying the "items" element name
1 Answer 35 Views
This is a migrated thread and some comments may be shown as answers.
Andre Perusse
Top achievements
Rank 1
Andre Perusse asked on 03 May 2012, 05:02 PM
For the TreeView control, is it possible to have a data structure where the sub-items belong to an element other than one called "items"? For example, if I have the following structure:

$("#treeView").kendoTreeView({
     dataSource: [ { category: "A", nodes: [{name:"Node 1"}, {name:"Node 2"}]} ]
});


I know I can use a template for the "category" element at the top level, but I'm not sure how I can specify that the sub-items are in the "nodes" element.

<script id="treeview-template" type="text/kendo-ui-template">
    # if (item.category) { #
    #= item.category #
    # } #
   // How do I now tell it to render the "nodes" element as children to the category element?
</script>

1 Answer, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 04 May 2012, 07:40 AM
Hello Andre,

This is currently not supported. The JSON should contain "items". This will be addressed once we have a true hierarchical DataSource and the treeview binds to it.

All the best,
Alex Gyoshev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Asked by
Andre Perusse
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Share this question
or