Sencha Touch 2.x:在Config中指定监听器 - howto

时间:2014-06-03 13:18:15

标签: extjs sencha-touch

我正在尝试在列表视图中添加itemtap事件的侦听器,但是,当列表正确显示时(即从存储中加载),并且我点击列表中的项目,则不会触发侦听器功能< / p>

这是因为我无法在配置中定义侦听器:在Ext.define()中?

由于

Ext.define('Volt.view.FeedView', {
    extend: 'Ext.Panel',



    xtype: 'feedViewCard',
    config: {
        iconCls: 'home',
        title: 'FeedView',

        layout: {
            type: 'vbox'
        },

        items: [



            {
                xtype: 'list',

                itemTpl: '<div class="list-item-title">{title}</div> <div class="list-item-narrative">{narrative}</div>',

                flex: 1,
                listeners: {

                    itemtap: function(list, index, target, record, e, eOpts ){
                        console.log('List tapped , xtype = ' , list.getXTypes() );
                        debugger;
                    } //however when the list shows up and I tap the items, this function is not triggered

                },
                initialize: function(){
                    console.log('listview initialize');
                    console.log('XType = ',this.getXTypes(),'id = ',this.getId());
                    //console.log('XType = ',list.getXTypes());
                    //debugger;
                    this.setStore(Ext.getStore('Feeds')); 

                }

            }

        ]
    },


});

0 个答案:

没有答案