我有一个树视图,dragAndDrop
设置为 true。当树的叶节点转换为内部节点时,通过将一些子节点放入其中,它开始表现出奇怪的行为。如果我折叠此节点,它将不会再次展开。如果我把另一个孩子丢给它,那就更奇怪了。这是我使用的代码:
var inline = new kendo.data.HierarchicalDataSource({
data: [
{ categoryName: "Storage", subCategories: [
{ subCategoryName: "Wall Shelving" },
{ subCategoryName: "Floor Shelving" },
{ subCategoryName: "Kids Storage" }
] },
{ categoryName: "Lights", subCategories: [
{ subCategoryName: "Ceiling" },
{ subCategoryName: "Table" },
{ subCategoryName: "Floor" }
] }
],
schema: {
model: {
children: "subCategories"
}
}
});
$("#label-tree").kendoTreeView({
dragAndDrop: true,
loadOnDemand: false,
dataSource: inline,
dataTextField: [ "categoryName", "subCategoryName" ]
});
我尝试了其他定义数据源的方法,但最终结果相同。我做错了吗?