X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/2e847cf21b8ab9d15fa167b315ca5b2fa92638fc..ddde20c4d4ac6a8d53de079761155de813845b3c:/docs/output/Ext.EventObject.html diff --git a/docs/output/Ext.EventObject.html b/docs/output/Ext.EventObject.html index a3fd7ab6..35683502 100644 --- a/docs/output/Ext.EventObject.html +++ b/docs/output/Ext.EventObject.html @@ -1,20 +1,20 @@ -
Package: | Ext |
Defined In: | EventManager.js |
Class: | EventObject |
Extends: | Object |
For example:
-function handleClick(e, t){ // e is not a standard event object, it is a Ext.EventObject
- e.preventDefault();
- var target = e.getTarget(); // same as t (the target HTMLElement)
- ...
-}
-var myDiv = Ext.get("myDiv"); // get reference to an Ext.Element
-myDiv.on( // 'on' is shorthand for addListener
- "click", // perform an action on click of myDiv
- handleClick // reference to the action handler
-);
-// other methods to do the same:
-Ext.EventManager.on("myDiv", 'click', handleClick);
+Class Ext.EventObject
Package: Ext Defined In: EventManager.js Class: EventObject Extends: Object
Just as Ext.Element wraps around a native DOM node, Ext.EventObject
+wraps the browser's native event-object normalizing cross-browser differences,
+such as which mouse button is clicked, keys pressed, mechanisms to stop
+event-propagation along with a method to prevent default actions from taking place.
+For example:
+function handleClick(e, t){ // e is not a standard event object, it is a Ext.EventObject
+ e.preventDefault();
+ var target = e.getTarget(); // same as t (the target HTMLElement)
+ ...
+}
+var myDiv = Ext.get("myDiv"); // get reference to an Ext.Element
+myDiv.on( // 'on' is shorthand for addListener
+ "click", // perform an action on click of myDiv
+ handleClick // reference to the action handler
+);
+// other methods to do the same:
+Ext.EventManager.on("myDiv", 'click', handleClick);
Ext.EventManager.addListener("myDiv", 'click', handleClick);
This class is a singleton and cannot be created directly.Public Properties
This class has no public properties.Public Methods
Method Defined By getCharCode()
:
NumberGets the character code for the event.Gets the character code for the event.Parameters:- None.
Returns:Number
EventObject getKey()
@@ -27,7 +27,7 @@ Ext.EventManager.addListener("myDiv", 'click', handleClick);
:
HTMLElementGets the related target.Gets the related target.Parameters:- None.
Returns:HTMLElement
EventObject getTarget( [String selector
], [Number/Mixed maxDepth
], [Boolean returnEl
] )
:
- HTMLelementGets the target for the event.Gets the target for the event.Parameters:selector
: String(optional) A simple selector to filter the target or look for an ancestor of the targetmaxDepth
: Number/Mixed(optional) The max depth to
+ HTMLelementGets the target for the event.Gets the target for the event.Parameters:selector
: String(optional) A simple selector to filter the target or look for an ancestor of the targetmaxDepth
: Number/Mixed(optional) The max depth to
search as a number or element (defaults to 10 || document.body)returnEl
: Boolean(optional) True to return a Ext.Element object instead of DOM node
Returns:HTMLelement
EventObject getWheelDelta()
:
NumberNormalizes mouse wheel delta across browsersNormalizes mouse wheel delta across browsersParameters:- None.
Returns:Number
The delta
EventObject getXY()
@@ -40,17 +40,17 @@ Ext.EventManager.addListener("myDiv", 'click', handleClick);
:
voidCancels bubbling of the event.Cancels bubbling of the event.Parameters:- None.
Returns:- void
EventObject within( Mixed el
, [Boolean related
], Boolean allowEl
)
:
- BooleanReturns true if the target of this event is a child of el. Unless the allowEl parameter is set, it will return false...Returns true if the target of this event is a child of el. Unless the allowEl parameter is set, it will return false if if the target is el.
-Example usage:// Handle click on any child of an element
- Ext.getBody().on('click', function(e){
- if(e.within('some-el')){
- alert('Clicked on a child of some-el!');
- }
- });
-
- // Handle click directly on an element, ignoring clicks on child nodes
- Ext.getBody().on('click', function(e,t){
- if((t.id == 'some-el') && !e.within(t, true)){
- alert('Clicked directly on some-el!');
- }
+ BooleanReturns true if the target of this event is a child of el. Unless the allowEl parameter is set, it will return false...Returns true if the target of this event is a child of el. Unless the allowEl parameter is set, it will return false if if the target is el.
+Example usage:// Handle click on any child of an element
+ Ext.getBody().on('click', function(e){
+ if(e.within('some-el')){
+ alert('Clicked on a child of some-el!');
+ }
+ });
+
+ // Handle click directly on an element, ignoring clicks on child nodes
+ Ext.getBody().on('click', function(e,t){
+ if((t.id == 'some-el') && !e.within(t, true)){
+ alert('Clicked directly on some-el!');
+ }
});
Parameters:el
: MixedThe id, DOM element or Ext.Element to checkrelated
: Boolean(optional) true to test if the related target is within el instead of the targetallowEl
: Boolean{optional} true to also check if the passed element is the target or related target
Returns:Boolean
EventObject
Public Events
This class has no public events.
\ No newline at end of file