-4

I am new in the ext js development. I need a extjs button with icon and text on it. The button behavior (onmouseover , onclick etc) should be same as extjs button. I am using icon from svg file.

Below are the steps that i am trying, but it does not behave like extjs button:

  1. Panel.js :

xtype: 'button', iconCls: 'svgImage', minWidth: 20, maxWidth: 40, localized: { text: 'localtext' }

Here even if i add the style:'background-color:#eeefea' for the xtype it will disappear the image from the button.

I am thankful, if anyone face the same issue and having solution for the same.

datta bsawant
  • 23
  • 1
  • 6

1 Answers1

0

There are two config options to set button's image:

  • iconCls - one or more space separated CSS classes to be applied to the icon element
  • icon - Url to the icon

See my live demo here: https://ext4all.com/post/extjs-6-button-with-svg-icon.html

khmurach
  • 484
  • 4
  • 10
  • Hi khmurach thanks for the reply. I achieved the same by using your suggestion and its gives me result as per the expected. – datta bsawant Oct 09 '17 at 09:11