Dojo Question:
Download Questions PDF

Example of Tree in Dojo Framework?


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.dataAPI.

There are following steps for creating Dojo trees :

Create a rooted or rootless trees (forests)
Nest, each branch is independently expandible
Different icons for different leaf or branch classes
Tree data are stored in any implementing API.
Events fire when users clicked on it.
Add, remove or disable nodes of tree.


<style type="text/css">
@import "../resources/dojo.css";
@import "../dijit/themes/tundra/tundra.css";

<script type="text/javascript" src="dojo.xd.js"
djConfig="parseOnLoad: true"></script>


<body class="tundra">
Simple Tree:
<div dojoType=""
url="tree.txt" jsid="popStore" />
<div dojoType="dijit.Tree" store="popStore"
labelAttr="sname" label="Tree"></div>

tree.txt file contains:
{ label: 'name',
identifier: 'name',
items: [
{ name:'Students', type:'cat',
children: [
{ name:'Vinod', type:'st' },
{ name:'Suman', type:'st' },
{ name:'Deepak', type:'st' }

Download Dojo Interview Questions And Answers PDF

Previous QuestionNext Question
Example of Radio Button in Dojo framework?What is Widget Toolkit in Dojo?