Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get rid of icons in extjs tree

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.

like image 377
alex Avatar asked Jul 05 '11 09:07

alex


2 Answers

ExtJS relies on CSS for styling, so the easiest way to remove the icons is to create a CSS rule that overrides one provided by Ext.

This will do the job :

.x-tree-icon { display: none !important; }

Add a class with the extraCls config option or use the component ID to qualify the rule if necessary.

As for the bold text, there doesn't seem to be a way using just CSS, so you could listen to the afterRender event of the tree view, though that won't be enough if you add nodes dynamically.

like image 157
jd. Avatar answered Oct 14 '22 03:10

jd.


In the column definition:

columns: [{
    xtype: 'treecolumn',
    text: 'Task',
    iconCls: '', // This property to get rid of tree icon
    width: 200,
    sortable: true,
    dataIndex: 'someStringIdentifier',
    locked: true
}
like image 25
Michel Avatar answered Oct 14 '22 02:10

Michel