PDA

View Full Version : What does delegate mean in the listener



niaz
30 Jun 2010, 12:18 PM
i have run across the example below from the EXT JS example webside and was not sure of the what
{delegate:'a'} meant in the listener. I looked at the docs but didnt find anything


new Ext.ToolTip({
title: '<a href="#">Rich Content Tooltip</a>',
id: 'content-anchor-tip',
target: 'leftCallout',
anchor: 'left',
html: null,
width: 415,
autoHide: false,
closable: true,
contentEl: 'content-tip', // load content from the page
listeners: {
'render': function(){
this.header.on('click', function(e){
e.stopEvent();
Ext.Msg.alert('Link', 'Link to something interesting.');
Ext.getCmp('content-anchor-tip').hide();
}, this, {delegate:'a'});
}
}
});

Animal
30 Jun 2010, 12:30 PM
The API docs for Element.addListener contain all the details you need. Huge detail.

davisty
11 Feb 2015, 12:52 PM
There is basically no documentation on delegate. Thus the questions. If there is PLEASE provide a link.

Abhijit Muke Interface
11 Apr 2016, 1:57 AM
https://docs.sencha.com/extjs/6.0/6.0.1-classic/#!/api/Ext.EventManager-method-addListener