There is the possibility to enable keyboard navigation in dhtmlxTree. Using keyboard navigation, the user can select any item in the tree and use the following keys:
Keyboard navigation in the tree can be enabled/disabled in the following way:
<script> tree.enableKeyboardNavigation(true|false); </script>
This method should be called before any of the data loading methods.
The user can also set new navigation keys using assignKeys() method:
<script> tree.assignKeys([["up",104],["down",98],["open",102],["close",100],["call",101]]); // should be called when keyboard navigation is already switched on </script>
The first parameter is the name of the action, the second one indicates the key code.
The method below allows to scroll to the indicated item from script:
<script> tree.focusItem(itemId); </script>
In this case the item is not selected/highlighted.
To select an item from script, the user should call the following command:
<script> tree.selectItem(itemId,mode,preserve); </script>
The parameters here are as follows:
Method clearSelection() removes the selection of the specified item in the tree:
<script> tree.clearSelection(itemId); </script>
Multiselection in the tree allows the user to select multiple items using Ctrl+click. Drag-and-drop is also supported in multiselection mode, as well as Cut and Paste functionality.
<script> tree.enableMultiselection(mode, strict); </script>
The parameters are as follows:
There is the possibility to switch on item's highlighting feature - when it is on, item's label will be highlighted when the mouse pointer is over it. This feature is operated like this:
<script> tree.enableHighlighting(true|false); // is switched off by default </script>
When this method is set to false, it is switched off, while setting it to true, switches this feature on.