Sencha Touch:单品披露

时间:2011-10-09 10:56:42

标签: android list sencha-touch disclosure

我在Sencha Touch中有一个正常的列表。 现在我需要将该列表中的单个项目标记为“披露”项目。

功能应该是这样的:

onItemDisclosure: function(record) {
    if (record.data.type != "link") return false; //not a disclosure
    return true;  //disclosure item
}

这可能实现吗?

1 个答案:

答案 0 :(得分:2)

试试这个:

new Ext.List({
    onItemDisclosure:true,
    store:'Events',
    itemTpl:'{date} {name}',
    listeners:{
        afterrender:function(cmp){
            this.store.each(function(record,index,itemsCount){
                if(record.data.type != "link"){
                    Ext.select('.x-list-disclosure',cmp.getNode(index)).remove();
                }
            });                         
        },
        itemtap:function(list,index,item){
            var record = this.store.getAt(index);
            if(record.data.type == "link"){
                // do action
            }               
        }
    }
})
相关问题