Properties Methods Events Direct Link

Class CQ.Ext.EventObject

Package:CQ.Ext
Class:EventObject
Extends:Object
Clientlib:cq.widgets
Just as CQ.Ext.Element wraps around a native DOM node, CQ.Ext.EventObject wraps the browser's native event-object normalizing cross-browser differences, such as which mouse button is clicked, keys pressed, mechanisms to stop event-propagation along with a method to prevent default actions from taking place.

For example:

function handleClick(e, t){ // e is not a standard event object, it is a CQ.Ext.EventObject
    e.preventDefault();
    var target = e.getTarget(); // same as t (the target HTMLElement)
    ...
}
var myDiv = CQ.Ext.get("myDiv");  // get reference to an CQ.Ext.Element
myDiv.on(         // 'on' is shorthand for addListener
    "click",      // perform an action on click of myDiv
    handleClick   // reference to the action handler
);
// other methods to do the same:
CQ.Ext.EventManager.on("myDiv", 'click', handleClick);
CQ.Ext.EventManager.addListener("myDiv", 'click', handleClick);


This class is a singleton and cannot be created directly.

Public Properties

This class has no public properties.

Public Methods

Method Defined By

Public Events

This class has no public events.