- The Book of Dojo
- Quick Installation
- Hello World
- Debugging Tutorial
- Introduction
- Part 1: Life With Dojo
- Part 2: Dijit
- Part 3: JavaScript With Dojo and Dijit
- Part 4: Testing, Tuning and Debugging
- Part 5: DojoX
- The Dojo Book, 0.4
Tree Tag
Submitted by criecke on Sat, 11/17/2007 - 14:50.
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
Action | Key |
---|---|
Navigate to first tree item* | Tab |
Navigate to the next sibling | Down arrow |
Navigate to the previous sibling | Up arrow |
Open a subtree | Right arrow |
Close a subtree | Left arrow |
Navigate to open subtree | Right arrow |
Navigate to parent | Left arrow |
Activate a tree item | Enter |
* Note: The last tree item focused will be in the Tab order.
- Printer-friendly version
- Login or register to post comments
- Subscribe post