Documentation
Reference
2.1.50 (current version)
collection
interactivityModel
Interfaces

IEventManager

Extends IEventTrigger.

Event manager. Using an event manager, you can subscribe to and unsubscribe from events, as well as initiate the events themselves.

Constructor | Methods

Constructor

IEventManager()

Methods

NameReturnsDescription
add(types, callback[, context[, priority]])

IEventManager

Adds a new subscription.

fire(type[, event])

IEventManager

Triggers an event.

getParent()

IEventManager|null

Returns reference to the parent event manager.

group()

IEventGroup

Returns the group of event listeners associated with the given event manager.

remove(types, callback[, context[, priority]])

IEventManager

Removes an existing subscription.

setParent(parent)

Sets the parent event manager.

Methods details

add

Adds a new subscription.

Returns self-reference.

Parameters:

ParameterDefault valueDescription
types*
[no-highlight[

* Mandatory parameter/option.

]no-highlight]

Type: String|String[]

Type or array of types for the event.

callback*
[no-highlight[

* Mandatory parameter/option.

]no-highlight]

Type: Function

Handler function for the event. An object describing the event is passed to the function as a parameter. It can be either an arbitrary object, or implement the interface IEvent.

context

Type: Object

Context for the handler.

priority 0

Type: Integer

Subscription priority.

* Mandatory parameter/option.

fire

Triggers an event.

Returns self-reference.

Parameters:

ParameterDefault valueDescription
type*
[no-highlight[

* Mandatory parameter/option.

]no-highlight]

Type: String

Type of event.

event

Type: Object|Event

Event. If a hash with data is passed, the createEventObject method will be called for it and further actions will be performed with the newly created event.

* Mandatory parameter/option.

getParent

{IEventManager|null} getParent()

Returns reference to the parent event manager.

group

{IEventGroup} group()

Returns the group of event listeners associated with the given event manager.

remove

Removes an existing subscription.

Returns self-reference.

Parameters:

ParameterDefault valueDescription
types*
[no-highlight[

* Mandatory parameter/option.

]no-highlight]

Type: String|String[]

Type or array of types for the event.

callback*
[no-highlight[

* Mandatory parameter/option.

]no-highlight]

Type: Function

Handler function for the event. The function is passed an object of the event IEvent.

context

Type: Object

Context for the handler.

priority 0

Type: Integer

Subscription priority.

* Mandatory parameter/option.

setParent

{} setParent(parent)

Sets the parent event manager.

Parameters:

ParameterDefault valueDescription
parent*
[no-highlight[

* Mandatory parameter/option.

]no-highlight]

Type: IEventManager|null

Parent event manager.

* Mandatory parameter/option.