adambuckley
25 Sep 2012, 10:55 AM
Hi All,
I'm just starting out with Ext JS 4. I have found that if include an image in a container, then I must supply image width and height configs otherwise the image won't be rendered properly.
Why is this? I thought that if they are not specified, Ext JS would just inspect an image to retrieve the dimensions automatically (like HTML does).
Here is a code fragment:
Ext.define('ExtCopNew.view.PageHeader',
{
extend : 'Ext.Container',
alias : 'widget.pageHeader',
region : 'north',
cls : 'pageHeader',
padding : 20,
items : [
{
xtype : 'container',
layout :
{
type : 'vbox'
},
items : [
{
xtype : 'image',
src : 'img/logo.jpg',
height : 58,
width : 116
} ]
} ]
});
This works as I've supplied the width and height. If I remove them, then my image vanishes!
Many thanks, Adam.
I'm just starting out with Ext JS 4. I have found that if include an image in a container, then I must supply image width and height configs otherwise the image won't be rendered properly.
Why is this? I thought that if they are not specified, Ext JS would just inspect an image to retrieve the dimensions automatically (like HTML does).
Here is a code fragment:
Ext.define('ExtCopNew.view.PageHeader',
{
extend : 'Ext.Container',
alias : 'widget.pageHeader',
region : 'north',
cls : 'pageHeader',
padding : 20,
items : [
{
xtype : 'container',
layout :
{
type : 'vbox'
},
items : [
{
xtype : 'image',
src : 'img/logo.jpg',
height : 58,
width : 116
} ]
} ]
});
This works as I've supplied the width and height. If I remove them, then my image vanishes!
Many thanks, Adam.