Initialization options
Data type and data source optionsUnordered list markup
Current example demonstrates multi level file tree with default options, initialized from an <ul>
element.
- Menu item with key and tooltip
-
Collapsed folder
- Sub-item 1.1
- Sub-item 1.2
- This is a selected item
Load JSON data
In this example multi level file tree initialized from JSON
data type and attached to <div>
block element.
Embed JSON data
To embed JSON data in the markup, specify data type via data-type
attribute and hide it using .d-none
class.
Drag and drop support
Fancytree supports drag'n'drop of tree nodes and behave like a standard jQuery UI draggable and droppable.
Selectable nodes
Single an multiple selectionsMultiple select
This tree has multi selection enabled: a single-click handler selects the node; a keydown handler selects on space.
Disable selection
You can turn off a node selection by adding .hideCheckbox
class to it or disable it using .unselectable
class.
Tree persistence
Store and restore tree status using cookies or local storage: click, expand or select nodes and reload the page.
Toggle checkboxes state
Change checkboxes state programmatically using setSelected()
parameter with true
or false
properties.
Hierarchical select
Hierarchical multi selection example. A single-click handler selects the node; a keydown handler selects on space.
- Menu item with key and tooltip
-
Collapsed folder
- Sub-item 1.1
- Sub-item 1.2
- Basic menu item with HTML support
Single select
Single select example: a double-click handler selects a document node; a keydown handler selects on space.
Various examples
Fancytree examples with optionsEditable nodes
Node titles can be changed via inline editing using dblclick
, Shift + click [F2] or Enter (on Mac only).
Child counter
The following example demonstrates optional tiny badges that display count of children elements at parent node.
Toggle state
This example demonstrates the usage of some Fancytree API functions, such as disabling and enabling file tree.
Tree sorting
This example demonstrates a sorting
feature of child list by title in 2 ways: full tree and in active nodes only.
- This is a selected item
-
Collapsed folder
- Sub-item 1.1
- Sub-item 1.2
Table tree
table.js
extension. The tree table extension takes care of rendering the node into one of the columns. Other columns have to be rendered in the renderColumns
event.
# | Items | Key | Like | |
---|---|---|---|---|