this
reference) in which the handler function is executed. Defaults to the Element.this
reference) in which the handler function is executed. Defaults to the Element.See Ext.core.Element.addListener for examples of how to use these options.
this
reference) in which the handler function executes. Defaults to the browser window.this
reference) in which the handler function executes. Defaults to the browser window.this
reference) was specified when the listener was added,
then this must refer to the same object.// 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!');
}
});