-
15 Dec 2011 2:35 PM #1
Answered: Replace badgeCls help
Answered: Replace badgeCls help
I have a form button that uses a unique badgeCls. I want the badgeCls to switch to senchas standard 'x-badge' under certain conditions.
Tried the following without success:
Any ideas on how to switch to a different badge css class?Code:Ext.getCmp('myButton').badgeElement.replaceCls("x-badge", "checkmark");
Thanks in advance.
-
Best Answer Posted by sissonb
I had the same problem too. I never found a clean way to do it, but here it is. If someone has a cleaner solution please post it.
So I was using the badge to show errors and warning. When there are only warnings I change the badge to yellow. Here is how I did that.
The CSSCode:app.views.sCartMessages.setBadge(wrnmsg.count); app.views.sCartMessages.addCls('yellow');
HTML Code:.yellow .x-badge { background-color: #ffff00 !important; background-image:-webkit-gradient( linear, 50% 0%, 50% 100%, color-stop(0%, #FFFF00), color-stop(50%, #E5E500), color-stop(51%, #E5E500), color-stop(100%, #FFFF19)) !important; color:#000; }
-
15 Dec 2011 2:45 PM #2
I had the same problem too. I never found a clean way to do it, but here it is. If someone has a cleaner solution please post it.
So I was using the badge to show errors and warning. When there are only warnings I change the badge to yellow. Here is how I did that.
The CSSCode:app.views.sCartMessages.setBadge(wrnmsg.count); app.views.sCartMessages.addCls('yellow');
HTML Code:.yellow .x-badge { background-color: #ffff00 !important; background-image:-webkit-gradient( linear, 50% 0%, 50% 100%, color-stop(0%, #FFFF00), color-stop(50%, #E5E500), color-stop(51%, #E5E500), color-stop(100%, #FFFF19)) !important; color:#000; }Last edited by sissonb; 15 Dec 2011 at 2:48 PM. Reason: clean css


Reply With Quote