A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.dhtmlx.com/suite/tree/events_handling/ below:

Website Navigation


JavaScript Tree - Event Handling

Event Handling Attaching event listeners​

You can attach event listeners with the tree.events.on() method:

tree.events.on("itemClick", function(id, e){
console.log("The item with the id "+ id +" was clicked.");
});

note

The names of events are case-insensitive.

Related sample: Tree. Events

Detaching event listeners​

To detach events, use tree.events.detach():

tree.events.on("itemClick", function(id, e){
console.log("The item with the id "+ id +" was clicked.");
});

tree.events.detach("itemClick");
Calling events​

To call events, use tree.events.fire():

tree.events.fire("name",args);
// where args is an array of arguments
The list of events​

The full list of events is available in the related API section.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4