YUI recommends YUI 3.
YUI 2 has been deprecated since 2011. This site acts as an archive for files and documentation.
CustomEvent
createEvent
(
p_type
,
p_config
)
p_type <string>
the type, or name of the event
p_config <object>
optional config params. Valid properties are:
CustomEvent
boolean
fireEvent
(
p_type
,
arguments
)
p_type <string>
the type, or name of the event
arguments <Object*>
an arbitrary set of parameters to pass to
the handler.
boolean
void
hasEvent
(
type
)
type <string>
the type, or name of the event
void
void
subscribe
(
p_type
,
p_fn
,
p_obj
,
p_override
)
p_type <string>
the type, or name of the event
p_fn <function>
the function to exectute when the event fires
p_obj <Object>
An object to be passed along when the event
fires
p_override <boolean>
If true, the obj passed in becomes the
execution scope of the listener
void
boolean
unsubscribe
(
p_type
,
p_fn
,
p_obj
)
p_type <string>
The type, or name of the event. If the type
is not specified, it will attempt to remove
the listener from all hosted events.
p_fn <Function>
The subscribed function to unsubscribe, if not
supplied, all subscribers will be removed.
p_obj <Object>
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)
boolean
void
unsubscribeAll
(
p_type
)
p_type <string>
The type, or name of the event
void