1. #1
    Sencha User
    Join Date
    Dec 2011
    Posts
    58
    Vote Rating
    6
    WillBill is on a distinguished road

      0  

    Default Cannot call method 'setHeight' of undefined

    Cannot call method 'setHeight' of undefined


    Hi,

    I'm not sure if this is a bug or if I'm just messing up. But i'm trying to add an Image to my panel view,
    but it seems when I try to define it's size i get a "Cannot call method 'setHeight' of undefined" error.

    Not sure why this is, but if i use flex it does show up. But flex messes up my layout (probably due to
    my lack of it's understanding), so I really need to be able to set its height/width.

    PHP Code:
    Ext.define('App.view.Home', {
        
    extend        'Ext.Panel',
        
    alias        'widget.home',
        
    config    : {
            
    items    : [
                {
                    
    xtype    'navigationbar',
                    
    title    'Home',
                    
    items    : [
                        {
                            
    xtype    'button',
                            
    text    'knop',
                            
    align    'right',
                            
    itemId    'menuBtn'
                        
    }
                    ]
                },
                {
                    
    xtype    'image',
                    
    src        'app/images/logo.jpg',
                    
    height    150,
                    
    width    400
                
    }
            ]
        }
    }); 
    //Edit//
    I can set its height/width in CSS, which solves my problem for now. But I'm still confused as to why it throws an error.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,220
    Vote Rating
    859
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    It was an error in PR3 but has been fixed for the next release.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

Thread Participants: 1