Event
pentaho.lang. Event
The Event
class is the base class of a certain kind of event objects that can be emitted by event sources
.
The source of an event is the object that emits it and is given by the event's source
property.
The type of an event is given by its type
property.
Event Cancellation
Certain types of events are used to signal that an action is about to execute (or that a phase of an already executing action is about to start). When the execution of the action can be canceled by the event listeners, the event is said to be cancelable. That characteristic is exposed by the isCancelable
property.
When an event is canceled, the listeners of unprocessed registrations are not notified.
To cancel an event, call its cancel
method. To find out if an event has been canceled, read the isCanceled
property.
Persistable Events
Certain types of events are emitted so frequently that it makes it highly beneficial to reuse event objects. To safely use an event object beyond its emission, a cloned event object must be obtained, through clone
.
AMD Module
require(["pentaho/lang/Event"], function(Event) { /* code goes here */ });
Constructor
Name | Description |
---|---|
new Event(type, source, cancelable) | Creates an event of a given type, source, and ability to be canceled. |
Members
Name | Description |
---|---|
cancelReason : | Gets the reason why the event was canceled, if any, or |
isCancelable : | Gets a value that indicates if the event can be canceled. |
isCanceled : | Gets a value that indicates if the event has been canceled. |
source : | Gets the source of the event. |
type : | Gets the type of the event. |
Methods
Name | Description |
---|---|
cancel(reason) | Cancels the event. |
clone() : pentaho.lang.Event | Creates a clone of the event object. |
Constructor Details
new Event(type, source, cancelable) | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Creates an event of a given type, source, and ability to be canceled. Source: javascript/web/pentaho/lang/Event.js, line 27
|
Members Details
cancelReason: |
---|
Gets the reason why the event was canceled, if any, or |
isCancelable: |
---|
Gets a value that indicates if the event can be canceled. |
isCanceled: |
---|
Gets a value that indicates if the event has been canceled. |
source: |
---|
Gets the source of the event. |
type: |
---|
Gets the type of the event. |
Methods Details
cancel(reason) | ||||||
---|---|---|---|---|---|---|
Cancels the event. This method has no effect if the event is not cancelable or has already been canceled. Source: javascript/web/pentaho/lang/Event.js, line 131
See also: pentaho.lang.Event#isCancelable , pentaho.lang.Event#isCanceled , pentaho.lang.Event#cancelReason |
clone() : pentaho.lang.Event | ||||
---|---|---|---|---|
Creates a clone of the event object. Source: javascript/web/pentaho/lang/Event.js, line 161
|