new Object(options, data)
Base object class which provides custom event management. In theory, every framework class should extend this class.
Parameters:
Name | Type | Argument | Description |
---|---|---|---|
options |
Object |
<optional> |
Class options. |
data |
* |
<optional> |
Class data |
- Source:
Extends
- goog.events.EventTarget
Members
-
<static> EventTypes :string
-
Events enum emitted by the Object at some point.
Type:
- string
- Source:
Properties:
Name Type Default Description DESTROYED
string Destroyed
Methods
-
destroy()
-
Destroys the object. Emits the following events before and after the object is destroyed. Sets data and options to null and calls the
dispose
anddisposeInternal
on parent to make a proper clean up. Callingdispose
will set theObject.isDisposed
to true and callingdisposeInternal
will unlisten all binded events so there won't be any event and/or memory leak.- Source:
-
emit(eventName, data)
-
Dispatches an event and calls all listeners listening for events of this event. See also goog.events.Listenable.prototype.dispatchEvent
Parameters:
Name Type Argument Description eventName
string Name of the event.
data
* <optional>
Data which will passed to listeners
- Source:
-
freeze()
-
Freezes object to prevent adding new properties, updating or deleting existing properties.
- Source:
-
getData() → {*}
-
Returns class data.
- Source:
Returns:
Class data.
- Type
- *
-
getOption() → {*}
-
Returns value of a key in options object.
- Source:
Returns:
Value of key or null.
- Type
- *
-
getOptions() → {Object}
-
Returns all options object.
- Source:
Returns:
Options object.
- Type
- Object
-
getUid() → {string}
-
Return unique id.
- Source:
Returns:
Unique id of this component.
- Type
- string
-
isDestroyed() → {boolean}
-
Returns the object's destroy state.
- Source:
Returns:
Whether the object is destroyed or not.
- Type
- boolean
-
off(eventName, callback) → {boolean}
-
Removes an event listener which was added with @on or @once. See also goog.events.Listenable.prototype.unlisten
Parameters:
Name Type Description eventName
string Name of the event.
callback
function Callback function for the event.
- Source:
Returns:
Whether any listener was removed.
- Type
- boolean
-
on(eventName, callback) → {goog.events.ListenableKey|number}
-
Adds an event listener. See also goog.events.Listenable::listen
Parameters:
Name Type Description eventName
string Name of the event.
callback
function Callback function for the event.
- Source:
Returns:
Unique key for the listener.
- Type
- goog.events.ListenableKey | number
-
once(eventName, callback) → {goog.events.ListenableKey|number}
-
Adds an event listener that is removed automatically after the listener fired once. See also goog.events.Listenable.prototype.listenOnce
Parameters:
Name Type Description eventName
string Name of the event.
callback
function Callback function for the event.
- Source:
Returns:
Unique key for the listener.
- Type
- goog.events.ListenableKey | number
-
setData(data)
-
Sets data of this class.
Parameters:
Name Type Description data
* Data passed to class.
- Source:
-
setOptions(options)
-
Sets options object of this class.
Parameters:
Name Type Description options
Object Options object.
- Source:
-
<private> setUid_()
-
Sets uid.
- Source: