In this section, you will learn about the tree and how to create a tree in dojo.
Tree : The tree is a GUI that helps to lists the hierarchical lists. The tree widget is a simple but the real power comes in the data. It represents the hierarchical structure of tree. Data is fed by the powerful dojo.data API.
There are following steps for creating Dojo trees :
Here is the code of Program:
<html>
|
tree.txt: In JSON format.
| { label: 'name', identifier: 'name', items: [ { name:'Students', type:'cat', children: [ { name:'Vinod', type:'st' }, { name:'Suman', type:'st' }, { name:'Deepak', type:'st' } ] }, { name:'Fruits', type: 'cat', children: [ { name:'Apple', type:'fr' }, { name:'Mango', type:'fr' }, { name:'Graps', type:'fr', children: [ { name:'Sweets', type:'gr' }, { name:'Sour', type:'gr' }, { name:'Salt', type:'gr' } ] } ] }, { name:'Vegetables', type: 'cat'}, { name:'Education', type:'cat'} ] } |
Output of the Program:

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.
Ask Questions? Discuss: Dojo Tree
Post your Comment