Skip to main content

Event handling

Attaching event listeners

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

richtext.events.on("Change", function(action, canUndo, canRedo){
// your code here
});

Related sample: RichText. Events

note

The names of events are case-insensitive.

Detaching event listeners

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

var change = richtext.events.on("Change", function(action, canUndo, canRedo){
// your code here
});
richtext.events.detach(change);

Calling events

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

richtext.events.fire("name", args);
// where args is an array of arguments

The list of events is available in the API section.