【发布时间】:2017-05-16 22:20:39
【问题描述】:
我是 Jquery 的 Fancytree 插件的新手。
我想延迟加载树的节点。
我无法从不同来源加载这些节点。
两个节点都从同一个单一来源获取数据。 我希望节点“Lazy Folder1”应该从 sample1.json 加载数据 并且节点“Lazy Folder2”应该从 sample2.json 加载数据
$(function(){
var sampleSource = [
{ title: "Lazy Folder1", lazy: true },
{ title: "Lazy Folder2", lazy: true }
];
$("#tree").fancytree({
source: sampleSource,
lazyLoad: function(event, data) {
data.result = { url: "sample1.json" };
}
});
});
以下是 plunker 的链接:-
【问题讨论】: