DHTMLX Docs & Samples Explorer

onClick Event

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

  • id - id of the clicked item
tree.attachEvent("onClick", function(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>