简体   繁体   中英

Make some items of Nestedlist unclickable in Sencha Touch

I have a nestedlist filled with items. I want to make some of the items unclickable. Is there a variable to unset or some kind of flag I can set?

UPDATE. Under items I mean the data loaded from Store object.

The solution is simple. I have just override basic function onItemTap of my nestedlist and base my function on code from basic function. Than I have implemented some needed logic and that's it.

onItemTap: function(list, index, target, record, e) {
    var me = this,
    store = list.getStore(),
    node = store.getAt(index);

    var is_separator = record.get('separator');

    me.fireEvent('itemtap', this, list, index, target, record, e);
    if (node.isLeaf()) {
        if (! is_separator) {
            me.fireEvent('leafitemtap', this, list, index, target, record, e);
            me.goToLeaf(node);
        }
    } else {
        if (! is_separator) {
            this.goToNode(node);
        }
    }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM