androidlistsencha-touchdisclosure

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

Is this possible to achieve?


Solution

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