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:
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.
$(
"#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
>