Skip to content

Commit

Permalink
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -58,23 +58,23 @@ var data = {
var tree = new InfiniteTree({
el: document.querySelector('#tree'),
data: data,
autoOpen: true, // open all nodes
droppable: true, // droppable
loadNodes: function(parentNode, done) { // load node on demand
autoOpen: true, // True to open all nodes on initial loading
droppable: true,
loadNodes: function(parentNode, done) { // Load node on demand
var nodes = [];
setTimeout(function() { // Loading...
done(null, nodes);
}, 1000);
},
nodeIdAttr: 'data-id', // the node id attribute
shouldSelectNode: function(node) { // determine if the node is selectable
rowRenderer: function(node, treeOptions) { // Customizable renderer
return '<div aria-id="<node-id>" class="tree-item">' + node.name + '</div>';
},
shouldSelectNode: function(node) { // Determine if the node is selectable
if (!node || (node === tree.getSelectedNode())) {
return false; // prevent from deselecting the current node
return false; // Prevent from deselecting the current node
}
return true;
},
rowRenderer: function(node, treeOptions) { // customizable renderer
return '<div aria-id="<node-id>" class="tree-item">' + node.name + '</div>';
}
});
```

0 comments on commit 57d0536

Please sign in to comment.