To attract attention of the users on some events we can change the glyph visual properties e.g. color or background color. We can also animate the icon, I wouldn’t use the animations, but, you know, there’s no accounting for taste… In the following example I will show to you how to do it at the base of button glyph icon. The visual effects can be implemented in form of override, extension of the class or using ‘Mixins’. All these effects can be overlapped i.e. the button’s icon can beat and rotate at the same time.

The beating and rotating visual actions are in a form of mixins. Here we must be careful not to override existing methods.

 

The glyph color and background colors are implemented in form of class extension. Here I am overriding the iconTpl of ‘Ext.button.Button’ to change the color by Internalisation of the class.