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
--- | ---
| A : Number Key constant | EventManager
| ALT : Number Key constant | EventManager
| B : Number Key constant | EventManager
| BACKSPACE : Number Key constant | EventManager
| C : Number Key constant | EventManager
| CAPS_LOCK : Number Key constant | EventManager
| CONTEXT_MENU : Number Key constant | EventManager
| CTRL : Number Key constant | EventManager
| D : Number Key constant | EventManager
| DELETE : Number Key constant | EventManager
| DOWN : Number Key constant | EventManager
| E : Number Key constant | EventManager
| EIGHT : Number Key constant | EventManager
| END : Number Key constant | EventManager
| ENTER : Number Key constant | EventManager
| ESC : Number Key constant | EventManager
| F : Number Key constant | EventManager
| F1 : Number Key constant | EventManager
| F10 : Number Key constant | EventManager
| F11 : Number Key constant | EventManager
| F12 : Number Key constant | EventManager
| F2 : Number Key constant | EventManager
| F3 : Number Key constant | EventManager
| F4 : Number Key constant | EventManager
| F5 : Number Key constant | EventManager
| F6 : Number Key constant | EventManager
| F7 : Number Key constant | EventManager
| F8 : Number Key constant | EventManager
| F9 : Number Key constant | EventManager
| FIVE : Number Key constant | EventManager
| FOUR : Number Key constant | EventManager
| G : Number Key constant | EventManager
| H : Number Key constant | EventManager
| HOME : Number Key constant | EventManager
| I : Number Key constant | EventManager
| INSERT : Number Key constant | EventManager
| J : Number Key constant | EventManager
| K : Number Key constant | EventManager
| L : Number Key constant | EventManager
| LEFT : Number Key constant | EventManager
| M : Number Key constant | EventManager
| N : Number Key constant | EventManager
| NINE : Number Key constant | EventManager
| NUM_CENTER : Number Key constant | EventManager
| NUM_DIVISION : Number Key constant | EventManager
| NUM_EIGHT : Number Key constant | EventManager
| NUM_FIVE : Number Key constant | EventManager
| NUM_FOUR : Number Key constant | EventManager
| NUM_MINUS : Number Key constant | EventManager
| NUM_MULTIPLY : Number Key constant | EventManager
| NUM_NINE : Number Key constant | EventManager
| NUM_ONE : Number Key constant | EventManager
| NUM_PERIOD : Number Key constant | EventManager
| NUM_PLUS : Number Key constant | EventManager
| NUM_SEVEN : Number Key constant | EventManager
| NUM_SIX : Number Key constant | EventManager
| NUM_THREE : Number Key constant | EventManager
| NUM_TWO : Number Key constant | EventManager
| NUM_ZERO : Number Key constant | EventManager
| O : Number Key constant | EventManager
| ONE : Number Key constant | EventManager
| P : Number Key constant | EventManager
| PAGE_DOWN : Number Key constant | EventManager
| PAGE_UP : Number Key constant | EventManager
| PAUSE : Number Key constant | EventManager
| PRINT_SCREEN : Number Key constant | EventManager
| Q : Number Key constant | EventManager
| R : Number Key constant | EventManager
| RETURN : Number Key constant | EventManager
| RIGHT : Number Key constant | EventManager
| S : Number Key constant | EventManager
| SEVEN : Number Key constant | EventManager
| SHIFT : Number Key constant | EventManager
| SIX : Number Key constant | EventManager
| SPACE : Number Key constant | EventManager
| T : Number Key constant | EventManager
| TAB : Number Key constant | EventManager
| THREE : Number Key constant | EventManager
| TWO : Number Key constant | EventManager
| U : Number Key constant | EventManager
| UP : Number Key constant | EventManager
| V : Number Key constant | EventManager
| W : Number Key constant | EventManager
| X : Number Key constant | EventManager
| Y : Number Key constant | EventManager
| Z : Number Key constant | EventManager
| ZERO : Number Key constant | EventManager
| correctRightMargin : Object In Webkit, there is an issue with getting the margin right property, see https://bugs.webkit.org/show_bug.cgi?id=1334... In Webkit, there is an issue with getting the margin right property, see https://bugs.webkit.org/show_bug.cgi?id=13343 | EventManager
| correctTransparentColor : Object Webkit browsers return rgba(0, 0, 0) when a transparent color is used | EventManager
| cssFloat : Object IE uses styleFloat, not cssFloat for the float property. | EventManager

fireDocReady : Object
Forces a document ready state transition for the framework. Used when Ext is loaded into a DOM structure AFTER initi...
Forces a document ready state transition for the framework. Used when Ext is loaded into a DOM structure AFTER initial page load (Google API or other dynamic load scenario. Any pending 'onDocumentReady' handlers will be fired (if not already handled).

EventManager

| function : Object Code used to detect certain browser feature/quirks/bugs at startup. | EventManager
| 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 name of the 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 (`this` reference) in which the handler function is executed. Defaults to the Element.
- `options` : Object
  (optional) An object containing handler configuration properties. This may contain any of the following properties:
  - scope : Object
    The scope (`this` reference) in which the handler function is executed. Defaults to the Element.
  - 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

function() : Boolean
Parameters:

- None.

Returns:

- `Boolean`
  True if the document is in a 'complete' state (or was determined to be true by other means). If false, the state is evaluated again until canceled.

EventManager

hasModifier() : Boolean
Returns true if the control, meta, shift or alt key was pressed during this event.
Returns true if the control, meta, shift or alt key was pressed during this event.
Parameters:

- None.

Returns:

- `Boolean`

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 name of the event to listen for.
- `handler` : Function
  The handler function the event invokes.
- `scope` : Object
  (optional) (`this` reference) in which the handler function executes. Defaults to the Element.
- `options` : Object
  (optional) An object containing standard addListener options

Returns:

- void

EventManager

onDocumentReady( `Function fn`, [`Object scope`], [`boolean options`] ) : void
Adds a listener to be notified when the document is ready (before onload and before images are loaded). Can be access...
Adds a listener to be notified 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) The scope (`this` reference) in which the handler function executes. Defaults to the browser window.
- `options` : boolean
  (optional) Options object as passed to Ext.Element.addListener. It is recommended that the options `{single: true}` be used so that the handler is removed on first invocation.

Returns:

- void

EventManager

onTextResize( `Function fn`, `Object scope`, `boolean options` ) : void
Adds a listener to be notified when the user changes the active text size. Handler gets called with 2 params, the old...
Adds a listener to be notified 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 function the event invokes.
- `scope` : Object
  The scope (`this` reference) in which the handler function executes. Defaults to the browser window.
- `options` : boolean
  Options object as passed to Ext.Element.addListener

Returns:

- void

EventManager

onWindowResize( `Function fn`, `Object scope`, `boolean options` ) : void
Adds a listener to be notified when the browser window is resized and provides resize event buffering (100 millisecon...
Adds a listener to be notified when the browser window is resized and provides resize event buffering (100 milliseconds), passes new viewport width and height to handlers.
Parameters:

- `fn` : Function
  The handler function the window resize event invokes.
- `scope` : Object
  The scope (`this` reference) in which the handler function executes. Defaults to the browser window.
- `options` : boolean
  Options object as passed to Ext.Element.addListener

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 all event handlers.

Returns:

- void

EventManager

removeListener( `String/HTMLElement el`, `String eventName`, `Function fn`, `Object scope` ) : 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 listener.
- `eventName` : String
  The name of the event.
- `fn` : Function
  The handler function to remove. This must be a reference to the function passed into the addListener call.
- `scope` : Object
  If a scope (`this` reference) was specified when the listener was added, then this must refer to the same object.

Returns:

- void

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`, `Object scope` ) : void
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 listener.
- `eventName` : String
  The name of the event.
- `fn` : Function
  The handler function to remove. This must be a reference to the function passed into the on call.
- `scope` : Object
  If a scope (`this` reference) was specified when the listener was added, then this must refer to the same object.

Returns:

- void

EventManager

## Public Events

This class has no public events.