Oliver Watkins Oliver Watkins - 8 months ago 52
CSS Question

Adding icon to Extjs toolbar

I am trying to add an icon to my toolbar (arbitrary - not associated with a button).

In my CSS I define the URL like this :

.myCoolLookingIcon {
background-image: url('../ext-theme-gray/images/grid/columns.gif');

And that works fine if I am setting icons for buttons by using iconCls.

I would like this icon in a label or image

I have tried :

xtype: 'label',
iconCls: 'myCoolLookingIcon '


xtype: 'image',
html: '<img class="myCoolLookingIcon "/>'

but that doesn't seem to work in either case.


This is one of the way of achieving what you want (Not using the iconCls)

html: '<img src=\"path_to_icon\">'

Try this:

 html: '<img class="className" width="20" height="20">'

Giving width and height, makes it work.