事件

core functionality


init.jstree

triggered after all events are bound

loading.jstree

triggered after the loading text is shown and before loading starts

destroy.jstree

triggered before the tree is destroyed

loaded.jstree

triggered after the root node is loaded for the first time

ready.jstree

triggered after all nodes are finished loading

load_node.jstree

triggered after a node is loaded

nodeObject the node that was loading
statusBoolean was the node loaded successfully
load_all.jstree

triggered after a load_all call completes

nodeObject the recursively loaded node
model.jstree

triggered when new data is inserted to the tree model

nodesArray an array of node IDs
parentString the parent ID of the nodes
redraw.jstree

triggered after nodes are redrawn

nodesarray the redrawn nodes
before_open.jstree

triggered when a node is about to be opened (if the node is supposed to be in the DOM, it will be, but it won't be visible yet)

nodeObject the opened node
open_node.jstree

triggered when a node is opened (if there is an animation it will not be completed yet)

nodeObject the opened node
after_open.jstree

triggered when a node is opened and the animation is complete

nodeObject the opened node
close_node.jstree

triggered when a node is closed (if there is an animation it will not be complete yet)

nodeObject the closed node
after_close.jstree

triggered when a node is closed and the animation is complete

nodeObject the closed node
open_all.jstree

triggered when an open_all call completes

nodeObject the opened node
close_all.jstree

triggered when an close_all call completes

nodeObject the closed node
enable_node.jstree

triggered when an node is enabled

nodeObject the enabled node
disable_node.jstree

triggered when an node is disabled

nodeObject the disabled node
hide_node.jstree

triggered when an node is hidden

nodeObject the hidden node
show_node.jstree

triggered when an node is shown

nodeObject the shown node
hide_all.jstree

triggered when all nodes are hidden

nodesArray the IDs of all hidden nodes
show_all.jstree

triggered when all nodes are shown

nodesArray the IDs of all shown nodes
activate_node.jstree

triggered when an node is clicked or intercated with by the user

nodeObject
eventObject the ooriginal event (if any) which triggered the call (may be an empty object)
hover_node.jstree

triggered when an node is hovered

nodeObject
dehover_node.jstree

triggered when an node is no longer hovered

nodeObject
select_node.jstree

triggered when an node is selected

nodeObject
selectedArray the current selection
eventObject the event (if any) that triggered this select_node
changed.jstree

triggered when selection changes

nodeObject
actionObject the action that caused the selection to change
selectedArray the current selection
eventObject the event (if any) that triggered this changed event
deselect_node.jstree

triggered when an node is deselected

nodeObject
selectedArray the current selection
eventObject the event (if any) that triggered this deselect_node
select_all.jstree

triggered when all nodes are selected

selectedArray the current selection
deselect_all.jstree

triggered when all nodes are deselected

nodeObject the previous selection
selectedArray the current selection
set_state.jstree

triggered when a set_state call completes

refresh.jstree

triggered when a refresh call completes

refresh_node.jstree

triggered when a node is refreshed

nodeObject the refreshed node
nodesArray an array of the IDs of the nodes that were reloaded
set_id.jstree

triggered when a node id value is changed

nodeObject
oldString the old id
set_text.jstree

triggered when a node text value is changed

objObject
textString the new value
create_node.jstree

triggered when a node is created

nodeObject
parentString the parent's ID
positionNumber the position of the new node among the parent's children
rename_node.jstree

triggered when a node is renamed

nodeObject
textString the new value
oldString the old value
delete_node.jstree

triggered when a node is deleted

nodeObject
parentString the parent's ID
move_node.jstree

triggered when a node is moved

nodeObject
parentString the parent's ID
positionNumber the position of the node among the parent's children
old_parentString the old parent of the node
old_positionNumber the old position of the node
is_multiBoolean do the node and new parent belong to different instances
old_instancejsTree the instance the node came from
new_instancejsTree the instance of the new parent
copy_node.jstree

triggered when a node is copied

nodeObject the copied node
originalObject the original node
parentString the parent's ID
positionNumber the position of the node among the parent's children
old_parentString the old parent of the node
old_positionNumber the position of the original node
is_multiBoolean do the node and new parent belong to different instances
old_instancejsTree the instance the node came from
new_instancejsTree the instance of the new parent
cut.jstree

triggered when nodes are added to the buffer for moving

nodeArray
copy.jstree

triggered when nodes are added to the buffer for copying

nodeArray
paste.jstree

triggered when paste is invoked

parentString the ID of the receiving node
nodeArray the nodes in the buffer
modeString the performed operation - "copy_node" or "move_node"
clear_buffer.jstree

triggered when the copy / cut buffer is cleared

set_theme.jstree

triggered when a theme is set

themeString the new theme
show_stripes.jstree

triggered when stripes are shown

hide_stripes.jstree

triggered when stripes are hidden

show_dots.jstree

triggered when dots are shown

hide_dots.jstree

triggered when dots are hidden

show_icons.jstree

triggered when icons are shown

hide_icons.jstree

triggered when icons are hidden

show_ellipsis.jstree

triggered when ellisis is shown

hide_ellipsis.jstree

triggered when ellisis is hidden

Checkbox plugin


This plugin renders checkbox icons in front of each node, making multiple selection much easier.

It also supports tri-state behavior, meaning that if a node has a few of its children checked it will be rendered as undetermined, and state will be propagated up.

disable_checkbox.jstree

triggered when an node's checkbox is disabled

nodeObject
enable_checkbox.jstree

triggered when an node's checkbox is enabled

nodeObject
check_node.jstree

triggered when an node is checked (only if tie_selection in checkbox settings is false)

nodeObject
selectedArray the current selection
eventObject the event (if any) that triggered this check_node
uncheck_node.jstree

triggered when an node is unchecked (only if tie_selection in checkbox settings is false)

nodeObject
selectedArray the current selection
eventObject the event (if any) that triggered this uncheck_node
check_all.jstree

triggered when all nodes are checked (only if tie_selection in checkbox settings is false)

selectedArray the current selection
uncheck_all.jstree

triggered when all nodes are unchecked (only if tie_selection in checkbox settings is false)

nodeObject the previous selection
selectedArray the current selection

Contextmenu plugin


Shows a context menu when a node is right-clicked.

show_contextmenu.jstree

triggered when the contextmenu is shown for a node

nodeObject the node
xNumber the x-coordinate of the menu relative to the document
yNumber the y-coordinate of the menu relative to the document

Adds search functionality to jsTree.

search.jstree

triggered after search is complete

nodesjQuery a jQuery collection of matching nodes
strString the search string
resArray a collection of objects represeing the matching nodes
clear_search.jstree

triggered after search is complete

nodesjQuery a jQuery collection of matching nodes (the result from the last search)
strString the search string (the last search string)
resArray a collection of objects represeing the matching nodes (the result from the last search)

State plugin


Saves the state of the tree (selected nodes, opened nodes) on the user's computer using available options (localStorage, cookies, etc)

state_ready.jstree

triggered when the state plugin is finished restoring the state (and immediately after ready if there is no state to restore).