v0.7.0
Adds loadNodes option to load nodes on demand
var tree = new InfiniteTree({
el: document.querySelector('#tree'),
data: [
{ // node
id: '<node-id>',
label: 'Node Label',
// Set loadOnDemand to true if you want to load child nodes on demand
loadOnDemand: true
}
],
loadNodes: function(parentNode, done) {
var nodes = [
{
id: 'node1',
label: 'Node 1'
},
{
id: 'node2',
label: 'Node 2'
}
];
setTimeout(function() {
done(null, nodes);
}, 1000);
}
});