Skip to content

v0.7.0

Compare
Choose a tag to compare
@cheton cheton released this 07 Apr 11:39
· 434 commits to master since this release

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);
    }
});