Overview

daredevel’s jQuery Tree is a jQuery UI widget that you can use to add advanced features to an html tree built using nested unordered lists.

It’s designed to be fast, lightweight, simple to deploy and setup and highly configurable.

Documentation

Options

checkbox

Defines if tree nodes will have a checkbox field.


collapseDuration

Defines duration of collapse effect in ms. Works only if collapseEffect is not null.


collapseEffect

Defines the effect used for collapse node.


collapseUiIcon

Defines jQueryUI icon class used for collapse anchor.


collapsible

Define if tree nodes can be collapsed.


dnd

Defines if tree has drag and drop feature active.


expandDuration

Defines duration of expand effect in ms. Works only if expandEffect is not null.


expandEffect

Defines the effect used for expand node.


expandUiIcon

Defines jQueryUI icon class used for expand anchor.


leafUiIcon

Defines jQueryUI icon class used for leaf anchor.


selectable

Defines if tree nodes are selectable.


selectUiClass

Defines jQueryUI class used for selected labels.

Methods

addNode( attributes, parentLi, position )

Add a new node as children of passed one

attributes

Type: Object

New node attributes.

parentLi

Type: String or Object

Node under which new node will be attached. Object or selector string.

position

Type: Integer

Position of the node between brothers (expressed as positive integer).


check( li )

Check node

li

Type: String or Object

Node to check. Object or selector string.


checkAll( )

Check all tree elements


collapse( li, effect, force )

Collapse node

li

Type: String or Object

Node to collapse. Object or selector string.

effect

Type: Boolean

Apply effect.

force

Type: Boolean

Force to already collapse node.


collapseAll( )

Collapse all nodes of the tree


deselect( )

Deselect selected node


destroy( )

Cleanup DOM elements removing plugin instance


expand( li, effect, force )

Expand node

li

Type: String or Object

Node to expand. Object or selector string.

effect

Type: Boolean

Apply effect.

force

Type: Boolean

Force to already expanded node.


expandAll( )

Expand all nodes of the tree


isRoot( li )

Check if passed node is a root

li

Type: String or Object

Node to check if is root. Object or selector string.


moveNode( li, parentLi, position )

Move a node under new parent

li

Type: String or Object

Node to move. Object or selector string.

parentLi

Type: String or Object

Node under which node will be attached. Object or selector string.

position

Type: Integer

Position of the node between brothers (expressed as positive integer).


option( optionName )

Gets the value currently associated with the specified optionName.

optionName

Type: String

The name of the option to get.


option( )

Gets an object containing key/value pairs representing the current datepicker options hash.


option( optionName, value )

Sets the value of the datepicker option associated with the specified optionName.

optionName

Type: String

The name of the option to set.

value

Type: Object

A value to set for the option.


option( options )

Sets one or more options for the datepicker.

options

Type: Object

A map of option-value pairs to set.

Code examples:

$( ".selector" ).tree( "option", { collapseDuration: 1000 } );


parentNode( li )

Return parent li of the passed li

li

Type: String or Object

Node you want to get parent of. Object or selector string.


removeNode( li )

Remove a node from tree (node is not actually delete, but still in memory)

li

Type: String or Object

Node to remove. Object or selector string.


select( li )

Return a node

li

Type: String or Object

Node to select. Object or selector string.


selected( )

Return selected node


uncheck( li )

Uncheck node

li

Type: String or Object

Node to uncheck. Object or selector string.


uncheckAll( )

Uncheck all tree elements

add( event, element )

move( event, element )

remove( event, element )

collapse( event, element )

expand( event, element )

deselect( event, element )

Defines function to handle deselect event

event

element


drop( event, element )

Defines function to handle drop event

event

element


select( event, element )

Defines function to handle select event

event

element