Releases: cheton/infinite-tree
Releases · cheton/infinite-tree
v0.8.1
-
Updates the constructor interface. Now it can accept the element
el
as the first parameter. For example:new InfiniteTree(document.getElementById('#tree'), { ... });
-
Adds a max height for the
infinite-tree-content
class as default.infinite-tree-content { max-height: 400px; }
v0.8.0
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);
}
});
v0.6.3
- Adds shouldSelectNode option to determine if a node can be selected or deselected
v0.6.2
This update supports Internet Explorer 8
You need to include the es5-shim polyfill (and optionally JSON3) for Internet Explorer 8, as shown below:
<script src="//cdnjs.cloudflare.com/ajax/libs/es5-shim/4.5.7/es5-shim.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/es5-shim/4.5.7/es5-sham.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/json3/3.3.2/json3.min.js"></script>
v0.6.1
v0.6.0
Options
- Added
droppable
option (Defaults to false) - Added
selectable
option (Defaults to true) - Added
treeOptions
as the 2nd parameter that will pass to therowRenderer
function
Events
-
Changed
tree.on('drop', fn)
totree.on('dropNode', fn)
tree.on('dropNode', function(node, evt) { // Handle drop node event });
v0.5.0
v0.4.0
v0.3.0
Notable Changes
- Added
getChildNodes
to get a list of child nodes. - Added
addChildNodeAt
,appendChild
,insertNodeAfter
, andinsertNodeBefore
to insert a new node. - Added
flatten
to flatten parent-child nodes by performing full tree traversal using child-parent link. - Added
updateNode
to update the data of a node. - Added
toString
to serialize the current state of a node to a JSON string.
Other Changes
- Update dependencies: flattree@^0.8.1
- IE8 compatibility output