EventManager

Event DOM manager for internal use in Handsontable.

Methods

addEventListener(element, eventName, callback, options){function}

Register specified listener (eventName) to the element.

Parameters:
Name Type Default Description
element Element

Target element.

eventName String

Event name.

callback function

Function which will be called after event occur.

options AddEventListenerOptions | Boolean false optional

Listener options if object or useCapture if boolean.

Returns: {function} Returns function which you can easily call to remove that event

clear()

Clear all previously registered events.

destroy()

Destroy instance of EventManager, clearing all events of the context

destroyWithOwnEventsOnly()

Destroy instance of EventManager, clearing only the own events

fireEvent(element, eventName)

Trigger event at the specified target element.

Parameters:
Name Type Description
element Element

Target element.

eventName String

Event name.

removeEventListener(element, eventName, callback, onlyOwnEvents)

Remove the event listener previously registered.

Parameters:
Name Type Default Description
element Element

Target element.

eventName String

Event name.

callback function

Function to remove from the event target. It must be the same as during registration listener.

onlyOwnEvents Boolean false optional

Whether whould remove only events registered using this instance of EventManager

Class: EventManager