vendredi 17 octobre 2014

Replacing fieldLabel of displayfield with an image.

I'd like to create a displayfield but instead of a text fieldlabel I would like to have an image. How is that possible? I tried to use labelStyle but it doesn't seem to work correctly. I'm doing it like so:

Code:



{
xtype: 'displayfield',
value: userFullName,
margin: '0 15 0 5',
fieldLabel: ' ',
labelStyle: 'background-image:url(\'MYURLHERE\');'
}

For some reason the image renders many times and if I add no-repeat in the css line it breaks and the image doesn't render at all. Also since there is no labelHeight config I cannot change the image's height and again, putting something in the CSS breaks it. If someone can post a working fiddle of how to achieve this that would be great.

Thanks






Replacing fieldLabel of displayfield with an image.

Aucun commentaire:

Enregistrer un commentaire