PDA

View Full Version : Icon on button doesn't draw in extJS 4.2.1



Scorchmaker
13 Jan 2016, 6:11 AM
Hi!

After upgrading (4.1.1 -> 4.2.1) app I missed my icon on button.

js:

{
xtype : 'button',
id : 'mybutton',
iconCls : 'x-my-icon',
}


css:


.x-my-icon{
background-image: url("button_icon.png') !important;
}


In 4.1 it work properly, but after upgrade, Icon on button has been lost.

Can anybody explain, Why image on button didn't render on extJS 4.2.1?
Is there another method to create image button? (e.g. image button with text)

UPD: I think, It's "problem" of button, because most image are draw properly. Only images on buttons aren't drawing.

jdkhamba
13 Jan 2016, 7:04 AM
In your css code there doesn't seem to be any class called 'x-my-icon'.

Scorchmaker
14 Jan 2016, 3:01 AM
My mistake.

Actually, CSS looks like this:


.x-my-icon{
background-image: url('button_icon.png') !important;
}


But "x-my-icon" exist and before upgrade it worked fine.

jdkhamba
14 Jan 2016, 10:39 AM
In your css are you using background position anywhere? Because that seems to get overridden by the extjs styles If you put !important on the background position, it seems to work

https://fiddle.sencha.com/#fiddle/13sf

In this example you can try removing and adding !important to notice the difference in behaviour.

Scorchmaker
15 Jan 2016, 6:28 AM
Thanks a lot! The problem is solved!