| Package: | Ext |
| Class: | EventManager |
| Extends: | Object |
| Defined In: | EventManager.js |
| Property | Defined By | |
|---|---|---|
| ieDeferSrc : Object | EventManager | |
| Url used for onDocumentReady with using SSL (defaults to Ext.SSL_SECURE_URL) | ||
| textResizeInterval : Object | EventManager | |
| The frequency, in milliseconds, to check for text resize events (defaults to 50) | ||
| Method | Defined By | |
|---|---|---|
addListener( String/HTMLElement element, String eventName, Function handler, [Object scope], [Object options] ) : void |
EventManager | |
| Appends an event handler to an element (shorthand for addListener) | ||
onDocumentReady( Function fn, Object scope, boolean options ) : void |
EventManager | |
| Fires when the document is ready (before onload and before images are loaded). Can be accessed shorthanded Ext.onRea... | ||
onTextResize( Function fn, Object scope, boolean options ) : void |
EventManager | |
| Fires when the user changes the active text size. Handler gets called with 2 params, the old size and the new size. | ||
onWindowResize( Function fn, Object scope, boolean options ) : void |
EventManager | |
| Fires when the window is resized and provides resize event buffering (50 milliseconds), passes new viewport width and... | ||
removeListener( String/HTMLElement element, String eventName, Function fn ) : Boolean |
EventManager | |
| Removes an event handler | ||
removeResizeListener( Function fn, Object scope ) : void |
EventManager | |
| Removes the passed window resize listener. | ||
wrap( Function fn, Object scope, boolean override ) : Function |
EventManager | |
| Deprecated. This is no longer needed and is deprecated. Places a simple wrapper around an event handler to override t... | ||
public Object ieDeferSrc
public Object textResizeInterval
public function addListener( String/HTMLElement element, String eventName, Function handler, [Object scope], [Object options] )
element : String/HTMLElementeventName : Stringhandler : Functionscope : Objectoptions : Object
Combining Options
Using the options argument, it is possible to combine different types of listeners:
A normalized, delayed, one-time listener that auto stops the event and passes a custom argument (forumId)
el.on('click', this.onClick, this, {
single: true,
delay: 100,
stopEvent : true,
forumId: 4
});
Attaching multiple handlers in 1 call
The method also allows for a single argument to be passed which is a config object containing properties
which specify multiple handlers.
Code:
el.on({
'click' : {
fn: this.onClick
scope: this,
delay: 100
},
'mouseover' : {
fn: this.onMouseOver
scope: this
},
'mouseout' : {
fn: this.onMouseOut
scope: this
}
});
Or a shorthand syntax:
Code:
el.on({
'click' : this.onClick,
'mouseover' : this.onMouseOver,
'mouseout' : this.onMouseOut
scope: this
});voidpublic function onDocumentReady( Function fn, Object scope, boolean options )
fn : Functionscope : Objectoptions : booleanvoidpublic function onTextResize( Function fn, Object scope, boolean options )
fn : Functionscope : Objectoptions : booleanvoidpublic function onWindowResize( Function fn, Object scope, boolean options )
fn : Functionscope : Objectoptions : booleanvoidpublic function removeListener( String/HTMLElement element, String eventName, Function fn )
element : String/HTMLElementeventName : Stringfn : FunctionBooleanpublic function removeResizeListener( Function fn, Object scope )
fn : Functionscope : Objectvoidpublic function wrap( Function fn, Object scope, boolean override )
fn : Functionscope : Objectoverride : booleanFunction