Properties Methods Events Direct Link

# Class Ext.EventManager

Package: | Ext
Defined In: | EventManager.js
Class: | EventManager
Extends: | Object

Registers event handlers that want to receive a normalized EventObject instead of the standard browser event and provides several useful events directly. See Ext.EventObject for more details on normalized event objects.
This class is a singleton and cannot be created directly.

## Public Properties

This class has no public properties.

## Public Methods

Method | Defined By
--- | ---
| addListener( `String/HTMLElement el`, `String eventName`, `Function handler`, [`Object scope`], [`Object options`] ) : void Appends an event handler to an element. The shorthand version on is equivalent. Typically you will use Ext.Element.... Appends an event handler to an element. The shorthand version on is equivalent. Typically you will use Ext.Element.addListener directly on an Element in favor of calling this version. Parameters: `el` : String/HTMLElement The html element or id to assign the event handler to `eventName` : String The type of event to listen for `handler` : Function The handler function the event invokes This function is passed the following parameters: evt : EventObject The EventObject describing the event. t : Element The Element which was the target of the event. Note that this may be filtered by using the `delegate` option. o : Object The options object from the addListener call. `scope` : Object (optional) The scope in which to execute the handler function (the handler function's "this" context) `options` : Object (optional) An object containing handler configuration properties. This may contain any of the following properties: scope {Object} : The scope in which to execute the handler function. The handler function's "this" context. delegate {String} : A simple selector to filter the target or look for a descendant of the target stopEvent {Boolean} : True to stop the event. That is stop propagation, and prevent the default action. preventDefault {Boolean} : True to prevent the default action stopPropagation {Boolean} : True to prevent event propagation normalized {Boolean} : False to pass a browser event to the handler function instead of an Ext.EventObject delay {Number} : The number of milliseconds to delay the invocation of the handler after te event fires. single {Boolean} : True to add a handler to handle just the next firing of the event, and then remove itself. buffer {Number} : Causes the handler to be scheduled to run in an Ext.util.DelayedTask delayed by the specified number of milliseconds. If the event fires again within that time, the original handler is not invoked, but the new handler is scheduled in its place. target {Element} : Only call the handler if the event was fired on the target Element, not if the event was bubbled up from a child node. See Ext.Element.addListener for examples of how to use these options. Returns: void | EventManager
| on( `String/HTMLElement el`, `String eventName`, `Function handler`, [`Object scope`], [`Object options`] ) : void Appends an event handler to an element. Shorthand for addListener. Appends an event handler to an element. Shorthand for addListener. Parameters: `el` : String/HTMLElement The html element or id to assign the event handler to `eventName` : String The type of event to listen for `handler` : Function The handler function the event invokes `scope` : Object (optional) The scope in which to execute the handler function (the handler function's "this" context) `options` : Object (optional) An object containing standard addListener options Returns: void | EventManager
| onDocumentReady( `Function fn`, [`Object scope`], [`boolean options`] ) : void Fires when the document is ready (before onload and before images are loaded). Can be accessed shorthanded as Ext.onR... Fires when the document is ready (before onload and before images are loaded). Can be accessed shorthanded as Ext.onReady(). Parameters: `fn` : Function The method the event invokes `scope` : Object (optional) An object that becomes the scope of the handler `options` : boolean (optional) An object containing standard addListener options Returns: void | EventManager
| removeAll( `String/HTMLElement el` ) : void Removes all event handers from an element. Typically you will use Ext.Element.removeAllListeners directly on an Elem... Removes all event handers from an element. Typically you will use Ext.Element.removeAllListeners directly on an Element in favor of calling this version. Parameters: `el` : String/HTMLElement The id or html element from which to remove the event Returns: void | EventManager
| removeListener( `String/HTMLElement el`, `String eventName`, `Function fn` ) : void Removes an event handler from an element. The shorthand version un is equivalent. Typically you will use Ext.Elemen... Removes an event handler from an element. The shorthand version un is equivalent. Typically you will use Ext.Element.removeListener directly on an Element in favor of calling this version. Parameters: `el` : String/HTMLElement The id or html element from which to remove the event `eventName` : String The type of event `fn` : Function The handler function to remove Returns: void | EventManager
| un( `String/HTMLElement el`, `String eventName`, `Function fn` ) : Boolean Removes an event handler from an element. Shorthand for removeListener. Removes an event handler from an element. Shorthand for removeListener. Parameters: `el` : String/HTMLElement The id or html element from which to remove the event `eventName` : String The type of event `fn` : Function The handler function to remove Returns: `Boolean` True if a listener was actually removed, else false | EventManager

## Public Events

This class has no public events.