我的 View 中有一个列表,在其上声明监听器。如何从事件“itemdoubletap”
获取记录数据?
我的 View 中的代码:
{
xtype: 'list',
flex: 1,
store: 'loanliststore',
itemTpl: '贷款名:{loanname},描述:{loandesc}',
listeners: {
itemdoubletap: function(index, target, record, e, eOpts){
console.log(record.get('loanname'));
//the console said cant read the property 'get'
}
}
}
最佳答案
您缺少一个参数,请更改:
function(index, target, record, e, eOpts)
致:
function(cmp, index, target, record, e, eOpts)
关于javascript - sencha 如何从事件中获取数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33008451/