You are browsing the old site - check the new version out

back to the documentation homepage

jsTree v.1.0

hotkeys plugin


The hotkeys plugin enables keyboard navigation and shortcuts. Depends on the jquery.hotkeys plugin.


Expects an object:
each key is the keyboard shortcut (for possible values check the hotkeys plugin)
each value is a function executed in the instance's context, the return value is used as a return value for the event.

Simple example:

"del" : function () { this.remove(); }

By default "up", "ctrl+up", "shift+up", "down", "ctrl+down", "shift+down", "left", "ctrl+left", "shift+left", "right", "ctrl+right", "shift+right", "space", "ctrl+space", "shift+space", "f2", "del" are bound.
To override any of those - just specify your own function, to disable - just set to false.


Using the hotkeys plugin

Try pressing up/down/left/right/space/f2/del.


.enable_hotkeys ( )

Enable shortcuts on the instance (enabled by default).

.disable_hotkeys ( )

Disable shortcuts on the instance.