Results 1 to 3 of 3

Thread: How to hide disclocure button on some of list items?

  1. #1
    Sencha User
    Join Date
    Sep 2011

    Question How to hide disclocure button on some of list items?

    I really need a help to hide disclosure button for some items of a List.
    e.g. I want to hide the disclosure button for items with id = 0 (The items are from stores and each record have ID). Setting "false" for onItemDisclosure will make disclosure button on all item hidden.
    I've tried something like this:
    onItemDisclosure: function (record) {
    if (record.getId() != 0 ) {
    // do something
    // let the disclosure button show
    } else {
    return false;

    but it's not working. The disclosure button always shown.

    Can anyone please help me with this ?
    Thanks in advance.

  2. #2
    Sencha Premium Member
    Join Date
    May 2008
    Pasadena, California


    You would need to override the tpl that has been configured for the listed items in the initComponent method of Ext.List

    this snippet of code from Ext.List.initComponent has configured the list item tpl and if onItemDisclosure is true, it adds the class to each list item. You would need an if condition inside this tpl such that based on data perhaps, you included or excluded the x-list-disclosure class. Take a look at XTemplate for examples of adding if conditions to the tpl definition

            this.tpl = '<tpl for="."><div class="x-list-item ' + this.itemCls + '"><div class="x-list-item-body">' + this.itemTpl + '</div>';        this.tpl += '<div class="x-list-status"></div>';
            this.tpl += '<div class="x-list-analysis"></div>';
            if (this.onItemDisclosure) {
                this.tpl += '<div class="x-list-disclosure"></div>';
            this.tpl += '</div></tpl>';
            this.tpl = new Ext.XTemplate(this.tpl, memberFnsCombo);
    the other option may be to attempt to add your distinguishing logic to css3

  3. #3
    Sencha User
    Join Date
    Jun 2011

    Default push


Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts