如果我们只有一个具有相同名称的节点,实际上功能正常。 在这里,我需要检查两个名称相同的节点" Bar" Tree view should Check like this through Programatically
<script>
$("#tree").kendoTreeView({
checkboxes: {
checkChildren: true
},
dataSource: {
data: [
{ text: "Foo", expanded: true, items: [
{ text: "Bar" },
{ text: "Bar" },
{ text: "Baz" }
] }
]
}
});
var treeview = $("#tree").data("kendoTreeView");
var bar = treeview.findByText("Bar");
treeview.dataItem(bar).set("checked", true);
</script>