开发者

Sencha Touch: Disclosure on single item

I have a normal list in Sencha Touch. Now I need to mark a single item in that list as a "disclosure" item.

The functionality should be sth like this:

onItemDisclosure: function(record) {
    if (record.data.type != "link") return false; //not a disclosure
    return t开发者_运维知识库rue;  //disclosure item
}

Is this possible to achieve?


Try this:

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
            }               
        }
    }
})
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜