Sencha Touch: Disclosure on single item

2.1k views Asked by At

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 true;  //disclosure item
}

Is this possible to achieve?

1

There are 1 answers

0
Luis On BEST ANSWER

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