Specifying the "items" element name

2 posts, 0 answers
  1. Andre Perusse
    Andre Perusse avatar
    2 posts
    Member since:
    May 2006

    Posted 03 May 2012 Link to this post

    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>
  2. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2527 posts

    Posted 04 May 2012 Link to this post

    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!
Back to Top