<!DOCTYPE HTML
PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Tree and controller example</title> <!-- Import the basic default themes of digit. --> <style type="text/css"> @import "dijit/themes/tundra/tundra.css"; @import "dojo/resources/dojo.css"; </style> <!-- Import the top-level Dojo javascript file. Assumes that Dojo is provided in a dojo/ directory. In this simple webapp --> <script type="text/javascript" src="dojo/dojo.js" djConfig="parseOnLoad: true"></script> <!-- Import the widgets that this example uses. These are similar in concept to Java imports. or C #includes --> <script type="text/javascript"> dojo.require("dijit.Tree"); dojo.require("dojo.data.ItemFileReadStore"); </script> </head> <body class="tundra"> <!-- Initialize a data store. The data store is a data interface controller for the tree. --> <div dojoType="dojo.data.ItemFileReadStore" jsId="dataStore" url="simpleTree.json"> </div> <!-- Initialize the tree and give it the reference to the data store that will feed it data --> <div dojoType="dijit.Tree" store="dataStore"> </div> </body> </html> |
{ label: "name", items:[ { name:'Node 1', children:[ { name:'Node 1.1'}, { name:'Node 1.2'}, { name:'Node 1.3'} ]}, { name:'Node 2'}, { name:'Node 3', children:[ { name:'Node 3.1', children:[ { name:'Node 3.1.1'} ]} ]} ] } |