itemtap is not getting fired in list

橙三吉。 提交于 2019-12-11 12:48:13

问题


i have loaded json data into list in sencha touch using itemTpl , everything is getting displayed properly as of now but somehow itemtap event of the list is not getting fired. i don't know what is the reason, following is my code where one can see the listeners inside config and nothing happens there.

Ext.define('demo.view.ProfileList',{
    extend:'Ext.dataview.List',
    xtype:'profilelist',
    requires:[
        'demo.store.ProfileStore',
        'Ext.plugin.ListPaging'
    ],
    config:{
        plugins: [{
            xclass: 'Ext.plugin.ListPaging',
            autoPaging: true
        }],
        store:'ProfileStore',
        itemTpl: [ 
            '<div class="demo-inner-list-item">',
                '<table border="0" >',
                    '<tr>',
                        '<td rowspan="5">',
                            '<div class="demo-img-frame">',
                            '</div>',
                        '</td>',
                        '<td class="demo-list-text">{member_name}</td>',
                    '</tr>',
                    '<tr>',
                        '<td class="demo-list-sub-text">{member_status}</td>',
                    '</tr>',
                    '<tr>',
                        '<td class="demo-list-sub-text">{member_dob:date("F j , Y")}</td>',
                    '</tr>',
                    '<tr>',
                        '<td class="demo-list-sub-text">{member_designation} - {member_work_loc}</td>',
                    '</tr>',
                '</table>',
            '</div>'
        ],
        listeners: {
            itemtap: function (list, index, item, evt) {
                console.log("TAP");
            }
        }
    },
    initialize: function() {
        Ext.getStore('ProfileStore').load();
    }
});

回答1:


i found the problem i haven't called this.callParent() in my initializefunction of List



来源:https://stackoverflow.com/questions/18016343/itemtap-is-not-getting-fired-in-list

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!