To attach a handler function to an event, use the attachEvent method:
var myEditor = new dhtmlXEditor(parent: "editorObj");
myEditor.attachEvent("onAccess", function(name, ev){
alert("onAccess event fired, name: "+name);
});
Related sample: onAccess event
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.
To detach a handler function from an event, use the detachEvent method:
var eventId = myEditor.attachEvent("onAccess", function(name, ev){
alert("onAccess event fired, name: "+name);
});
myEditor.detachEvent(eventId); // the unique id of the event handler
You can find the full list of editor's events in the Editor API.
Back to top