Dojo Dijit and HTML5 in Real world applications/Dijit/dijit.Tree

dijit.Tree
This article show how to implement a dijit.Tree.

Dijit.Tree populated from a relational database
This tree is populated from a relational database where the children refer to the parents. (The normal example is where the parents hold a list of children).

The getChildren function is overwritten with a custom function. First the root is loaded (all top level items) then the children is loaded. In this implementation the server is only asked on time to get the file. Use the Firefox bugtrace to see how the children is loaded.

Play with the working example found here: dijit.tree example 1. There is also a tab showing the Json file used in the example. It is possible to test the code in various dojo versions.

AccordionContainer
The tree is implemented in a dijit.layout.AccordionContainer in the working example found here: dijit.tree example 1.

Verified in
IE 8, Firefox 3.6.22, Dojo 1.6.1