How to get rid of icons in extjs tree

Viewed 9512

I would like to get rid of the icons in an extjs tree. Instead i would like to set all the nodes that have children in bold.

3 Answers

Below my solution with ExtJS 6.5 that brings 2 advantages:

  • to focus on certain types of nodes only
  • to avoid the space between the trigger and the text

I define in the Model a calculated iconCls returning a custom css class:

{
    name: 'iconCls',
    calculate: function (data) {
        return 'uw-shrink-icon';
    }
}

Then in the sass file I take advantage of the native x-tree-icon-custom css class to set the width to 0:

.x-tree-icon-custom.uw-shrink-icon {
    background-image: none;
    width:0px;
}
Related