在我的列表视图中,我把addEventListener
(别名on
)在我的initialize
事件
initialize: function (component) {
component.element.on({
tap: {
scope: this,
fn: 'onTap',
delegate: 'div.side-itemDelete'
}
});
},
但是,如果有更多的delegate
(以身份证或其他类元素)我需要绑定一个事件,我该怎么处理呢?
这是我的XTemplate:
new Ext.XTemplate(
'<div class="side-weatherListItem no-dragging">',
'<div class="side-itemLocation">',
'<div>{[values.city.toUpperCase()]}</div>',
'<div>{[values.text.toUpperCase()]}</div>',
'</div>',
'<div class="side-itemTemperature">{temp}°{unit}</div>',
'<div class="side-itemState">',
'<div><img src="./resources/img/rain.svg"></div>',
'<div class="side-itemDate">11:38</div>',
'</div>',
'<div class="side-itemDelete" fire="onDelete">', // <<---- here
'<img src="./resources/img/delete.svg">',
'</div>',
'</div>'
),