PDA

View Full Version : strange behavior with Ext.Img inside a container



gkatz
20 Nov 2012, 1:57 AM
I have a simple chunk of code. it adds an Image (using Ext.Img) to a comtainer once image is loaded. for some reason, 'backgound' mode does not show.
can someone explain?
thanks in advance.


var cont = Ext.create('Ext.Container',{layout: 'hbox'});

var theImg = Ext.create('Ext.Img', {
src: 'http://i48.tinypic.com/33n7q7r.jpg',
mode: 'background',//does not display image even though css backgournd image is applied
//mode: 'none'//displays img as IMG tag
listeners: {
scope: cont,
load: function( img, event, eOpts ) {
this.add(img);
}
}
});
Ext.Viewport.add(cont);

gkatz
20 Nov 2012, 2:58 AM
layout: 'fit', solved it
thanks