事件
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
node | Object the node that was loading |
status | Boolean was the node loaded successfully |
load_all.jstree
triggered after a load_all call completes
node | Object the recursively loaded node |
model.jstree
triggered when new data is inserted to the tree model
nodes | Array an array of node IDs |
parent | String the parent ID of the nodes |
redraw.jstree
triggered after nodes are redrawn
nodes | array 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)
node | Object the opened node |
open_node.jstree
triggered when a node is opened (if there is an animation it will not be completed yet)
node | Object the opened node |
after_open.jstree
triggered when a node is opened and the animation is complete
node | Object the opened node |
close_node.jstree
triggered when a node is closed (if there is an animation it will not be complete yet)
node | Object the closed node |
after_close.jstree
triggered when a node is closed and the animation is complete
node | Object the closed node |
open_all.jstree
triggered when an open_all call completes
node | Object the opened node |
close_all.jstree
triggered when an close_all call completes
node | Object the closed node |
enable_node.jstree
triggered when an node is enabled
node | Object the enabled node |
disable_node.jstree
triggered when an node is disabled
node | Object the disabled node |
hide_node.jstree
triggered when an node is hidden
node | Object the hidden node |
show_node.jstree
triggered when an node is shown
node | Object the shown node |
hide_all.jstree
triggered when all nodes are hidden
nodes | Array the IDs of all hidden nodes |
show_all.jstree
triggered when all nodes are shown
nodes | Array the IDs of all shown nodes |
activate_node.jstree
triggered when an node is clicked or intercated with by the user
node | Object |
event | Object the ooriginal event (if any) which triggered the call (may be an empty object) |
hover_node.jstree
triggered when an node is hovered
node | Object |
dehover_node.jstree
triggered when an node is no longer hovered
node | Object |
select_node.jstree
triggered when an node is selected
node | Object |
selected | Array the current selection |
event | Object the event (if any) that triggered this select_node |
changed.jstree
triggered when selection changes
node | Object |
action | Object the action that caused the selection to change |
selected | Array the current selection |
event | Object the event (if any) that triggered this changed event |
deselect_node.jstree
triggered when an node is deselected
node | Object |
selected | Array the current selection |
event | Object the event (if any) that triggered this deselect_node |
select_all.jstree
triggered when all nodes are selected
selected | Array the current selection |
deselect_all.jstree
triggered when all nodes are deselected
node | Object the previous selection |
selected | Array 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
node | Object the refreshed node |
nodes | Array an array of the IDs of the nodes that were reloaded |
set_id.jstree
triggered when a node id value is changed
node | Object |
old | String the old id |
set_text.jstree
triggered when a node text value is changed
obj | Object |
text | String the new value |
create_node.jstree
triggered when a node is created
node | Object |
parent | String the parent's ID |
position | Number the position of the new node among the parent's children |
rename_node.jstree
triggered when a node is renamed
node | Object |
text | String the new value |
old | String the old value |
delete_node.jstree
triggered when a node is deleted
node | Object |
parent | String the parent's ID |
move_node.jstree
triggered when a node is moved
node | Object |
parent | String the parent's ID |
position | Number the position of the node among the parent's children |
old_parent | String the old parent of the node |
old_position | Number the old position of the node |
is_multi | Boolean do the node and new parent belong to different instances |
old_instance | jsTree the instance the node came from |
new_instance | jsTree the instance of the new parent |
copy_node.jstree
triggered when a node is copied
node | Object the copied node |
original | Object the original node |
parent | String the parent's ID |
position | Number the position of the node among the parent's children |
old_parent | String the old parent of the node |
old_position | Number the position of the original node |
is_multi | Boolean do the node and new parent belong to different instances |
old_instance | jsTree the instance the node came from |
new_instance | jsTree the instance of the new parent |
cut.jstree
triggered when nodes are added to the buffer for moving
node | Array |
copy.jstree
triggered when nodes are added to the buffer for copying
node | Array |
paste.jstree
triggered when paste is invoked
parent | String the ID of the receiving node |
node | Array the nodes in the buffer |
mode | String 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
theme | String 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
node | Object |
enable_checkbox.jstree
triggered when an node's checkbox is enabled
node | Object |
check_node.jstree
triggered when an node is checked (only if tie_selection in checkbox settings is false)
node | Object |
selected | Array the current selection |
event | Object 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)
node | Object |
selected | Array the current selection |
event | Object 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)
selected | Array the current selection |
uncheck_all.jstree
triggered when all nodes are unchecked (only if tie_selection in checkbox settings is false)
node | Object the previous selection |
selected | Array 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
node | Object the node |
x | Number the x-coordinate of the menu relative to the document |
y | Number the y-coordinate of the menu relative to the document |
Search plugin
Adds search functionality to jsTree.
search.jstree
triggered after search is complete
nodes | jQuery a jQuery collection of matching nodes |
str | String the search string |
res | Array a collection of objects represeing the matching nodes |
clear_search.jstree
triggered after search is complete
nodes | jQuery a jQuery collection of matching nodes (the result from the last search) |
str | String the search string (the last search string) |
res | Array 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).