YAHOO.util.CustomEvent
CustomEvent
Object
|
+--YAHOO.util.CustomEvent
Ubicada en yahoo.js
|
Métodos
boolean
|
fire()
|
Notifies the subscribers. |
void
|
subscribe(<Function> fn, <Object> obj, <boolean|Object> overrideContext)
|
Subscribes the caller to this event |
Object
|
toString()
|
|
boolean
|
unsubscribe(<Function> fn, <Object> obj)
|
Unsubscribes subscribers. |
int
|
unsubscribeAll()
|
Removes all listeners |
YAHOO.util.CustomEvent (<String> type, <Object> context, <boolean> silent, <int> signature)
|
|
The CustomEvent class lets you define events for your application
that can be subscribed to by one or more independent component.
Parámetros:
type
|
The type of event, which is passed to the callback when the event fires
|
context
|
The context the event will fire from. "this" will refer to this object in the callback. Default value: the window object. The listener can override this.
|
silent
|
pass true to prevent the event from writing to the debugsystem
|
signature
|
the signature that the custom event subscriber will receive. YAHOO.util.CustomEvent.LIST or YAHOO.util.CustomEvent.FLAT. The default is YAHOO.util.CustomEvent.LIST.
|
Notifies the subscribers. The callback functions will be executed
from the context specified when the event was created, and with the
following parameters:
- The type of event
- All of the arguments fire() was executed with as an array
- The custom object (if any) that was passed into the subscribe()
method
Parámetros:
arguments
|
an arbitrary set of parameters to pass to the handler.
|
Retorna:
false if one of the subscribers returned false, true otherwise |
void subscribe (<Function> fn, <Object> obj, <boolean|Object> overrideContext)
|
|
Subscribes the caller to this event
Parámetros:
fn
|
The function to execute
|
obj
|
An object to be passed along when the event fires
|
overrideContext
|
If true, the obj passed in becomes the execution context of the listener. if an object, that object becomes the the execution context.
|
boolean unsubscribe (<Function> fn, <Object> obj)
|
|
Unsubscribes subscribers.
Parámetros:
fn
|
The subscribed function to remove, if not supplied all will be removed
|
obj
|
The custom object passed to subscribe. This is optional, but if supplied will be used to disambiguate multiple listeners that are the same (e.g., you subscribe many object using a function that lives on the prototype)
|
Retorna:
True if the subscriber was found and detached. |
Retorna:
The number of listeners unsubscribed |
Desarrollado por SIU.
Documentación generada con JSDoc
|
|