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) |
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 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
});
void
public function onDocumentReady( Function fn
, Object scope
, boolean options
)
fn
: Functionscope
: Objectoptions
: booleanvoid
public function onTextResize( Function fn
, Object scope
, boolean options
)
fn
: Functionscope
: Objectoptions
: booleanvoid
public function onWindowResize( Function fn
, Object scope
, boolean options
)
fn
: Functionscope
: Objectoptions
: booleanvoid
public function removeListener( String/HTMLElement element
, String eventName
, Function fn
)
element
: String/HTMLElementeventName
: Stringfn
: FunctionBoolean
public function removeResizeListener( Function fn
, Object scope
)
fn
: Functionscope
: Objectvoid
public function wrap( Function fn
, Object scope
, boolean override
)
fn
: Functionscope
: Objectoverride
: booleanFunction