Login Register

Tree Tag

dijit.Tree, dijit._TreeNode
dijit.Tree is a container for a hierarchical list with expandable and collapsible items. dijit._TreeNode's are the items themselves. _TreeNodes are almost never created with markup, and in general you don't deal with them.
Attributes
childrenAttr String name of attribute that holds children of a tree node consider this "root node" to be always expanded
label String New in 1.0 label for the top node of the tree, if desired. Note there is no actual item associated with this node.
query String get top level node(s) of tree (ex: {type:'continent'})
store dojo.data.Store The store to get data to display in the tree
Methods
isExpanded if expandible, returns true if children are displayed
isExpandible returns true if node can be expanded (has an expando icon next to it)
Extension Points
getIconClass user overridable class to return CSS class name to display icon
getItemChildren User overridable function that return array of child items of given parent item, or if parentItem==null then return top items in tree
getItemParentIdentity User overridable function, to return id of parent (or null if top level). It's called with args from dojo.store.onNew
getLabel user overridable function to get the label for a tree node (given the item)
mayHaveChildren New in 1.0 User overridable function to tell if an item has or may have children. Controls whether or not +/- expando icon is shown. (For efficiency reasons we may not want to check if an element has children until user clicks the expando node)
onClick(item, node) Called when someone clicks a tree item

Accessibility

Keyboard

ActionKey
Navigate to first tree item*Tab
Navigate to the next siblingDown arrow
Navigate to the previous siblingUp arrow
Open a subtreeRight arrow
Close a subtreeLeft arrow
Navigate to open subtreeRight arrow
Navigate to parentLeft arrow
Activate a tree itemEnter

* Note: The last tree item focused will be in the Tab order.