I've a dataview, written with extjs 7.1 modern tookit, with a template with an anchor tag and a select event:
https://fiddle.sencha.com/#view/editor&fiddle/34bd
Ext.create({
renderTo: document.body,
xtype: 'list',
itemTpl: '<div class="contact"><a onclick="event.preventDefault();console.log(\'link\');" href="{firstName}">{firstName}</a> <b>{lastName}</b></div>',
store: {
data: [{
firstName: 'Peter',
lastName: 'Venkman'
}, {
firstName: 'Raymond',
lastName: 'Stantz'
}, {
firstName: 'Egon',
lastName: 'Spengler'
}, {
firstName: 'Winston',
lastName: 'Zeddemore'
}]
},
listeners: {
select() { console.log('select'); }
}
});
I expect the link event will be fired before the list select event, but the opposite happens and even worst both events will be fired one after another.
I'm trying to understand where the user clicks as you suggest but I don't know how.
As @LightNight said, you can use childtap
event to run needed handler before select. If you want to understand where the click occurred - just use event.target
. Look my example