[Dojo-interest] Help: dijit.Tree

Daniel daniel.carrera at zmsl.com
Mon Dec 10 14:43:12 UTC 2007


I swear, I'm going to go insane...


I can't figure out how to get a dijit tree working. I have read the 
following:

* Creating a widget programatically
http://www.dojotoolkit.org/book/dojo-book-0-9/part-3-programmatic-dijit-and-dojo/manipulating-widgets-through-code/displaying-w
* Tree widget:
http://www.dojotoolkit.org/book/dojo-book-0-9/part-2-dijit/advanced-editing-and-display/tree
* A Simple Tree
http://www.dojotoolkit.org/book/book-dojo/part-2-dijit-dojo-widget-library/advanced-editing-and-display/tree/simple-tree

You would think that would be enough to make a dumb tree, but apparently 
it isn't.

* Why do I need dojo.data.ItemFileReadStore to make a tree? What if I 
don't want to get the data from a file? Why is that there?

* How *do* I create a tree from a variable? Why does the following code:

var TreeData = { label: 'name',
		identifier: 'name',
		items: [
			{ name:'Fruit', type:'category'},
			{ name:'Cinammon', type: 'category'},
			{ name:'Chocolate', type: 'category'}
		]
	}
var tree = new dijit.Tree( TreeData, dojo.byId('Groups'));


Which is taken directly from the book with only the tiniest modification 
give me the error "this.store has no properties". What is a store and 
why do I need one to make a tree? I gave it the data, what more does it 
want?

Help please! :-(



More information about the Dojo-interest mailing list