1. #1
    Sencha User
    Join Date
    Nov 2010
    Posts
    403
    Vote Rating
    6
    gkatz is on a distinguished road

      0  

    Default strange behavior with Ext.Img inside a container

    strange behavior with Ext.Img inside a container


    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.
    Code:
            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);

  2. #2
    Sencha User
    Join Date
    Nov 2010
    Posts
    403
    Vote Rating
    6
    gkatz is on a distinguished road

      0  

    Default


    layout: 'fit', solved it
    thanks

Tags for this Thread