1. #1
    Sencha Premium Member
    Join Date
    Apr 2009
    Posts
    104
    Vote Rating
    0
    jej2003 is on a distinguished road

      0  

    Default Unanswered: Remove Tree Node leaf icon

    Unanswered: Remove Tree Node leaf icon


    Is it possible to remove a tree nodes icon? Setting the iconCls to x-tree-noicon used to work in 3.x, is there something equivalent that can be done with 4.x?

  2. #2
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,625
    Vote Rating
    331
    Answers
    550
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    I don't believe there's a CSS class built in but you can craft one pretty easily. From the title of your post I assume you want to remove icons for all leaf nodes? For that you could do something like this:

    Code:
    Ext.create('Ext.tree.Panel', {
        cls: 'no-leaf-icons',
        ...
    });
    Code:
    .no-leaf-icons .x-tree-icon-leaf {
        visibility: hidden;
        width: 2px; /* Adjust width to suit */
    }
    or alternatively:

    Code:
    .no-leaf-icons .x-tree-icon-leaf {
        display: none !important;
    }
    If you want to target individual nodes then the technique is much the same. In that case you'd add an iconCls to the node and then specify one of the CSS blocks above using that class as the selector.

Thread Participants: 1