YUI – YUI Event

http://developer.yahoo.com/yui/event/

YAHOO.util.Event.addListener(el, sType, fn, obj, overrideContext)

el: id, or a collection of ids
sType: the type of event to append (such as “click” http://www.quirksmode.org/dom/events/)
fn: the method the event invokes
obj: an arbitrary object that will be passed as a parameter to the handler
overrideContect: if true, the obj passed in becomes the execution context of the listener; if an object, this object becomes the execution context

YAHOO.util.Subscriber( fn , obj , overrideContext )

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

There are 2 main types of event subscriptions:

//DragDrop
var dd = new YAHOO.util.DD('dd');
dd.on('dragEvent', function() { });

//Panel
var panel = new YAHOO.widget.Panel('panel');
panel.renderEvent.subscribe(function() {});

//Calendar
var cal = new YAHOO.widget.Calendar('cal');
cal.selectEvent.subscribe(function() {});

//Editor
var editor = new YAHOO.widget.Editor('editor', {});
editor.on('afterRender', function() {});

Leave a Reply

Your email address will not be published. Required fields are marked *

*