Class: mootree

ajs.ui.tree. mootree

The class creates a navigable tree starting from an unordered html list (ul tag). It inserts the right controllers in order to collapse/expand trees. Every graphical aspect may be controlled by simple css stylesheet.

Available functionality:

  • Expand top: initially expand all the first tree (a classical blog archive behavior)
  • Collapse all: initially collapse or expand all trees
  • Expand level: initially expand the tree at a given level (beginning from level 0 which is always expanded)
  • Attribute data-expanded: if a li element has the attribute data-expanded set to 1, then the tree is expanded in order to show it initially
  • Selected item: the selected item (must have a css class named selected) is always shown initially

new mootree

Navigation tree user interface.

Parameters:
Name Type Description
element String | Element the unordered list dom element or its id attribute
options Object The class options object
Properties
Name Type Argument Default Description
load_css Boolean <optional>
true Whther to load or not the default css, you may provide your own one
expand_top Boolean <optional>
false Whether or not to expand completely the first branch
collapsed Boolean <optional>
true Whther or not to initially collapse the tree
expand_level Number <optional>
null The tree level to expand. Level 0 are all the first voices (always shown)
Source:
  • tree.js, line 130
Example
	var mt = new ajs.ui.tree.mootree('myelement', {expand_top: true});