To handle events of Ribbon and its TreeCollection, use the methods of the events module.
Attaching event handlers
You can add any handler to the events of Ribbon and its TreeCollection. To do this, use the ribbon.events.on() method with the following parameters:
|evName||name of the event|
|evHandler||user-defined event handler|
Several handlers can be attached to one and the same event, and all of them will be executed.
The names of the events are case-insensitive.
Related sample: Ribbon. Events
Detaching event handlers
There is a simple way of removing an event-handler. Call the ribbon.events.detach() method:
You do not need to call events of Ribbon and its TreeCollection. Yet, you can call any custom event with the fire() method of the events module:
List of supported events
You can find the full list of Ribbon events in the related API section.