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 User skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,086
    Vote Rating
    112
    Answers
    454
    skirtle is a splendid one to behold skirtle is a splendid one to behold skirtle is a splendid one to behold skirtle is a splendid one to behold skirtle is a splendid one to behold skirtle is a splendid one to behold skirtle is a splendid one to behold

      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.