我想基于数据源字段中定义的值来设置树视图的颜色,
从这个链接,我认为,我所要做的是可能的,但我不会在我的情况下使用MVVM,所以我所缺少以下? 任何想法??
http://www.telerik.com/forums/mvvm---treeview-only-updates-on-datatextfield-change
<div id="treeview"></div>
$("#treeview").kendoTreeView({
template: "#= item.text # color:#: item.color #",
dataSource: [
{ text: "green", color: "green", items: [
{ text: "yellow", color: "yellow" },
{ text: "red", color: "red" }
]},{
text: "blue", color: "blue"
}
]
});
小提琴链接, http://jsfiddle.net/KendoDev/qZeK6/