Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
cheton committed Apr 16, 2016
2 parents 465a4df + 4bddd4f commit 7229591
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ Need to include [es5-shim](https://github.com/es-shims/es5-shim#example-of-apply
## React Support
Check out <b>react-infinite-tree</b> at https://github.com/cheton/react-infinite-tree.

## Notice
<i>The project is under heavy development and a lot of things are changing. Stay tuned for further updates.</i>

## Installation
```bash
npm install --save infinite-tree
Expand Down Expand Up @@ -61,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 data-id="<node-id>" class="infinite-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>';
}
});
```
Expand Down

0 comments on commit 7229591

Please sign in to comment.