Documentation
Reference
2.1.56 (current version)
collection
interactivityModel
Interfaces

event.Group

Extends IEventGroup.

A group of event listeners.

Constructor | Fields | Methods

Constructor

event.Group(events)

Creates a group of event listeners.

Parameters:

ParameterDefault valueDescription
events *
[no-highlight[

* Mandatory parameter/option.

]no-highlight]

Type: IEventManager

The event manager that the group was created for.

* Mandatory parameter/option.

Example:

// Creating a group of event listeners.
var listeners = events.group()
   .add('click', function () {
       alert('click');
   })
   .add('dblclick', function () {
       alert('dblclick');
   });
// ...
// When the event handlers stored in the container
// are no longer needed, we simply clear the group.
listeners.removeAll();

Fields

NameTypeDescription
eventsIEventManager

The event manager that the group was created for.

Methods

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

IEventGroup

Adds an event listener.

Inherited from IEventGroup.

getLength()

Integer

Returns the current number of subscribers in the group.

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

IEventGroup

Deletes an event listener from the group.

Inherited from IEventGroup.

removeAll()

IEventGroup

Deletes all event listeners from the group.

Inherited from IEventGroup.

Fields details

events

{IEventManager} events

The event manager that the group was created for.

Methods details

getLength

{Integer} getLength()

Returns the current number of subscribers in the group.