Kendo ui 选择剑道树视图中的每个节点
我有这样一个剑道树视图:Kendo ui 选择剑道树视图中的每个节点,kendo-ui,kendo-treeview,Kendo Ui,Kendo Treeview,我有这样一个剑道树视图: sectionTreeView.kendoTreeView({ dataValueField: "Id", dataTextField: "Name", checkboxes: { checkChildren: true } }); var treeView = divTreeView.getKendoTreeView(); // you need to select the no
sectionTreeView.kendoTreeView({
dataValueField: "Id",
dataTextField: "Name",
checkboxes: {
checkChildren: true
}
});
var treeView = divTreeView.getKendoTreeView();
// you need to select the node for this to work
treeView.select(".k-item:first");
treeView.select().find(".k-checkbox input").prop("checked", true).change();
我使用以下代码以编程方式选择根节点:
divTreeView.getKendoTreeView().select(".k-item:first");
但是,第一个节点仅高亮显示,但其复选框保持未选中状态,其下的每个子节点也保持未选中状态。如何选中每个复选框?在选择以下节点后,请尝试选中复选框:
sectionTreeView.kendoTreeView({
dataValueField: "Id",
dataTextField: "Name",
checkboxes: {
checkChildren: true
}
});
var treeView = divTreeView.getKendoTreeView();
// you need to select the node for this to work
treeView.select(".k-item:first");
treeView.select().find(".k-checkbox input").prop("checked", true).change();
$(“#accountsTree.k-item input[type=checkbox]”).attr('checked','checked') 你能给你的一行加上一些描述吗?很好用。尝试了很多东西…但这帮了我。谢谢你boniestlawyer。。