sencha如何从事件中获取数据

时间:2015-10-08 06:45:14

标签: javascript extjs sencha-touch sencha-touch-2

我的视图中有一个列表声明了侦听器。如何从事件"itemdoubletap"获取记录数据?

我的代码在视图中:

{
    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'
        }
    }
}

1 个答案:

答案 0 :(得分:2)

你错过了一个参数,改变了:

function(index, target, record, e, eOpts)

要:

function(cmp, index, target, record, e, eOpts)