如何将图像设置为无线电场中的图标?

时间:2014-02-11 15:22:37

标签: extjs extjs4 radio-button

我有一组单选按钮。我无法将图像设置为无线电场中的图标。 这是我的代码:

items: [
{
    icon: 'img/rag123a.',
    name: 'rag',
    id: 'rag1',
    margin: '0 10 0 0'
}
]

我想要的东西:

enter image description here

2 个答案:

答案 0 :(得分:0)

也许您想在radiobutton的标签中显示图像?如果是的话,扭曲图像的一种方法是将其放入 boxLabel 中,如此jsfiddle http://jsfiddle.net/NUPD2/

所示

*图标的来源是在此示例* {/ p>中从https://www.iconfinder.com/icons/40737/bar_chart_icon#size=128复制的

{
            boxLabel: '<img src="url/to/image" width="20" height="20"/>',
            name: 'size',
            inputValue: 'l',
            id: 'radio2'
 }

答案 1 :(得分:0)

你可以试试这个:

      {
            xtype: 'radiogroup',
            columnWidth: 1,
            fieldLabel: 'Achat',
            items: [
            {
                xtype: 'radiofield',
                name: 'typeAchat',
                boxLabel: '<img src="images/optique/glasses.png"/>',
                checked: true,
                inputValue: 'lunetteOptique'
            },
            {
                xtype: 'radiofield',
                name: 'typeAchat',
                boxLabel: '<img src="images/optique/JustGlasse.png"/>',
                inputValue: 'glasses'
            },
             ...
            ]
        },
相关问题