class YAHOO.util.EventProvider
EventProvider is designed to be used with YAHOO.augment to wrap
CustomEvents in an interface that allows events to be subscribed to
and fired by name. This makes it possible for implementing code to
subscribe to an event that either has not been created yet, or will
not be created at all.
Properties
| Properties | Type | Description |
|---|---|---|
__yui_events
|
Object[]
private
|
↑
Private storage of custom events
|
__yui_subscribers
|
Object[]
private
|
↑
Private storage of custom event subscribers
|
Methods
| Methods | Returns | Description |
|---|---|---|
createEvent(
p_type, p_config
)
|
CustomEvent
|
↑
Creates a new custom event of the specified type. If a custom event
by that name already exists, it will not be re-created. In either
case the custom event is returned.
Parameters:
Returns: |
fireEvent(
p_type, arguments
)
|
boolean
|
↑
Fire a custom event by name. The callback functions will be executed
from the scope specified when the event was created, and with the
following parameters:
Parameters:
Returns: |
hasEvent(
type
)
|
void
|
↑
Returns true if the custom event of the provided type has been created
with createEvent.
Parameters:
|
subscribe(
p_type, p_fn, p_obj, overrideContext
)
|
void
|
↑
Subscribe to a CustomEvent by event type
Parameters:
|
unsubscribe(
p_type, p_fn, p_obj
)
|
boolean
|
↑
Unsubscribes one or more listeners the from the specified event
Parameters:
Returns: |
unsubscribeAll(
p_type
)
|
void
|
↑
Removes all listeners from the specified event. If the event type
is not specified, all listeners from all hosted custom events will
be removed.
Parameters:
|