Skip to main content

Events Bus


Detaches a handler from an event (which was attached before by the on() method)

void detach(string name, [any context] );

namestringthe name of event to detach
contextanya context marker"Change", function(action, canUndo, canRedo){  // your code here});"Change");


By default detach() removes all event handlers from the target event. You can detach particular event handlers by using the context marker.

var marker = "any"; // you can use any string|object value"Change", handler1);"Change", handler2, marker);// the next command will delete only"Change", marker);


Triggers an inner even

boolean fire(string name, array params);

namestringthe event's name, case-insensitive
paramsarrayan array of the event-related data


booleanfalse, if some of the event handlers return false. Otherwise, true"CustomEvent", function(param1, param2){    return true;}); var res ="CustomEvent", [12, "abc"]);


Normally, events are called automatically and you don't need to use this method.


Attaches a handler to an inner event of RichText

void on(string name, function handler, [any context]);

namestringthe event's name, case-insensitive
handlerhandlerthe handler function
contextanythe value will be accessible as "this" inside of the event handler"Change", function(action, canUndo, canRedo){  // your code here});


See the list of Richtext events.

You can attach several handlers to the same event and all of them will be executed. If some of handlers return false, the related operations will be blocked. Event handlers are processed in the same order that they are attached.