DHTMLX Docs & Samples Explorer

Index
dhtmlxtree
onClick Event

## onClick Event

This event calls user-defined handlers (if there are any) and passes the following parameters:

- id - id of the clicked item;
- id - id of the previously selected item.

            tree.attachEvent("onClick", function(id, id){});

Here is the example of using onClick event in the tree containing items with link-like functionality:

        <script>
            tree.attachEvent("onClick",function(id){
                window.open(tree.getUserData(id,"href"));
                return true;
            });
        </script>