Default Tree

This tree uses default options. It is initalized from a hidden ul element on this page.

Init from JS object

This sample initializes the tree from a JavaScript object. An onActivate handler brings up an alert box when a node is selected.

External data

This sample initializes the tree from a JSON request.

Active node: -
Checkbox

This tree has checkoxes and selectMode 1 (single-selection) enabled.
A double-click handler selects a document node (not folders).
A keydown handler selects on [space].
The checkbox class name was customized, to display radio buttons.

Active node: -
Selection: -
Multi-Selection

his tree has selectMode 2 (multi-selection) enabled. A single-click handler selects the node. A keydown handler selects on [space].

Selected keys: -
Drag-and-drop

This sample uses Dynatree's built-in drag-and-drop feature to move nodes.
- A node may only be dragged under it's original parent.
- When dropped, the node is moved to the target.