event.Group

Extends IEventGroup.

A group of event listeners.

Constructor | Fields | Methods

Constructor

event.Group(events)

Creates a group of event listeners.

Parameters:

Parameter

Default value

Description

events*

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

Name

Type

Description

events

IEventManager

The event manager that the group was created for.

Methods

Name

Returns

Description

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.