Kendo ui 展开/折叠剑道树视图中的文件夹在树很大时非常慢
我正在用剑道树视图创建一棵树,如下所示:Kendo ui 展开/折叠剑道树视图中的文件夹在树很大时非常慢,kendo-ui,treeview,kendo-treeview,Kendo Ui,Treeview,Kendo Treeview,我正在用剑道树视图创建一棵树,如下所示: const treeViewOptions: kendo.ui.TreeViewOptions = { dataBound: (e: kendo.ui.TreeViewDataBoundEvent): void => { // Add class to the treeItem that is a folder to distiguish between leaf and folder.
const treeViewOptions: kendo.ui.TreeViewOptions = {
dataBound: (e: kendo.ui.TreeViewDataBoundEvent): void => {
// Add class to the treeItem that is a folder to distiguish between leaf and folder.
const treeItem = $(this.treeViewElementId + ' .k-item:has(.k-group)');
if (treeItem.length > 0) {
treeItem.addClass("folder-tree-item");
}
},
dataSource: new kendo.data.HierarchicalDataSource({
sort: { field: "text", dir: "asc" },
transport: {
read: (options: kendo.data.DataSourceTransportOptions) => { this.onLoadFolder(options); }
},
schema: {
model: {
id: "id",
},
}
}),
dataSpriteCssClassField: "iconClass",
template:
// Text - I have a template here.
// Make all nodes load automatically before expanding
loadOnDemand: false,
// Apply scrolling when item focus changes
navigate: (e) => { this.onNavigate(e); },}
当我展开或折叠一个节点时,这会花费很多时间,直到文件夹打开/关闭
我该怎么办?
感谢解决方案已经在另一篇文章中讨论过,基本上您需要更新剑道ui或按照问题答案中给出的步骤进行操作 希望这对你有帮助:)