It's a pure JavaScript framework and it handles large tree types of data. dataTree is used to simple, fast, and lite weight. CRUD (Create, Read, Update, Delete) options available.
<script src="DataTree.js"></script>
<link href="DataTree.css">
<div id="datatree"></div>
<script>
var tree= new DataTree(
document.querySelector('#datatree'),
{name:'Creatures',d:[
{name:'Animals',d:[]},
{name:'Humans',
d:[{name:'Women',d:[]}, {name:'Men',d:[]}]
},
{name:'Brids',d:[]}
]}
);
</script>
new DataTree(element) new DataTree(element,data) new DataTree(element,data,warning)
data = { name: 'name', d[ { name: 'name', d[{...}] ,...}] }
Give DOM element, this element is the target place to create DataTree.
Give object, It's used to load DataTree content of the data.
It's a boolean data type (true or false) and the default value is true. confirm the message control parameter. If the given value is true. when try to delete data confirm popup asking 'Are sure to delete'.
DataTree.getData()
- It's used to get data of DataTree and its return object.
- code :
tree.getData();
- code :
DataTree.render()
- It's use to reprint html element.
- code :
tree.render();
- code :
Learn more about in minisuperfiles.blogspot.com