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

Property | Defined By
--- | ---
| ieDeferSrc : Object Url used for onDocumentReady with using SSL (defaults to Ext.SSL_SECURE_URL) | EventManager
| textResizeInterval : Object The frequency, in milliseconds, to check for text resize events (defaults to 50) | EventManager

## 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
- `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.

  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

onTextResize( `Function fn`, `Object scope`, `boolean options` ) : void
Fires when the user changes the active text size. Handler gets called with 2 params, the old size and the new size.
Fires when the user changes the active text size. Handler gets called with 2 params, the old size and the new size.
Parameters:

- `fn` : Function
  The method the event invokes
- `scope` : Object
  An object that becomes the scope of the handler
- `options` : boolean

Returns:

- `void`

EventManager

onWindowResize( `Function fn`, `Object scope`, `boolean options` ) : void
Fires when the window is resized and provides resize event buffering (50 milliseconds), passes new viewport width and...
Fires when the window is resized and provides resize event buffering (50 milliseconds), passes new viewport width and height to handlers.
Parameters:

- `fn` : Function
  The method the event invokes
- `scope` : Object
  An object that becomes the scope of the handler
- `options` : boolean

Returns:

- `void`

EventManager

removeListener( `String/HTMLElement el`, `String eventName`, `Function fn` ) : Boolean
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:

- `Boolean`
  True if a listener was actually removed, else false

EventManager

removeResizeListener( `Function fn`, `Object scope` ) : void
Removes the passed window resize listener.
Removes the passed window resize listener.
Parameters:

- `fn` : Function
  The method the event invokes
- `scope` : Object
  The scope of handler

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.