Skip to main content

Event handling

Attaching event listeners

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

treegrid.events.on("scroll", function({top,left}){
console.log("The treegrid is scrolled to "+top,left);
});
note

The names of events are case-insensitive.

Related sample: TreeGrid. TreeGrid Events

Detaching event listeners

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

treegrid.events.on("scroll", function({top,left}){
console.log("The treegrid is scrolled to "+top,left);
});

treegrid.events.detach("Scroll");

Calling events

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

treegrid.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.