1. #1
    Sencha User
    Join Date
    Jan 2012
    Location
    Jacksonville, FL
    Posts
    38
    Vote Rating
    2
    Answers
    2
    rwbaker is on a distinguished road

      0  

    Default Answered: Fullscreen image not showing

    Answered: Fullscreen image not showing


    I'm creating a panel with a titlebar and an image set to fullscreen. The image doesn't show unless it has a fixed height in pixels. Shouldn't fullscreen be enough?

    PHP Code:
        showMap: function(dataviewindexelementrecord) {

            var 
    mapPanel Ext.create('Ext.Panel', {            

                
    id          'firemapimg',

                
    items       : [
                    {
                        
    xtype      'toolbar',
                        
    title       record.get('title'),
                        
    docked      'top'
                    
    },
                    {
                         
    xtype       'image',
                        
    src         record.get('src'),
                        
    fullscreen  true
                   
    }
                ]
            });

            
    Ext.Viewport.animateActiveItem(mapPanel, {type'slide'direction'left'});
        } 

  2. You shouldn't use fullscreen config if it is a child of another component. Your mapPanel should use fit layout.

  3. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,548
    Vote Rating
    872
    Answers
    3566
    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


    You shouldn't use fullscreen config if it is a child of another component. Your mapPanel should use fit layout.
    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.

  4. #3
    Sencha User
    Join Date
    Jan 2012
    Location
    Jacksonville, FL
    Posts
    38
    Vote Rating
    2
    Answers
    2
    rwbaker is on a distinguished road

      0  

    Default


    Perfect, thanks.

  5. #4
    Sencha User
    Join Date
    Nov 2011
    Posts
    72
    Vote Rating
    0
    Answers
    3
    kalor is on a distinguished road

      0  

    Default


    Didn't work for me

    No matter what I do, images only appear if you set a specific height and width.

    Code:
        	            {
        	            	xtype: 'panel',
        	                layout: 'fit',
        	                items: [
        	                        {
        	                            xtype: 'image',
        	                            id: 'imgPic',
        	                            hidden: false,
    //    	                            flex: 1,
    //    	                            width: 250,
    //    	                            height: 250,
        	                            src:'<snip>'
        	                        }
        	                        ]
        	            }

  6. #5
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,548
    Vote Rating
    872
    Answers
    3566
    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


    In that code, as long as the panel has a size the child item will have the same height and width so I suspect the panel doesn't have a size.
    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.

  7. #6
    Sencha User
    Join Date
    Apr 2012
    Posts
    8
    Vote Rating
    0
    nirajanrk is on a distinguished road

      0  

    Default Resize the image?

    Resize the image?


    Thanks for the helpful reply!

    How does one resize the image? More so, I want it to autofit to its parent toolbar.
    Changing the height and width only clips it but doesn't actually resize it.
    Last edited by nirajanrk; 16 May 2012 at 1:30 PM. Reason: clarification

  8. #7
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,548
    Vote Rating
    872
    Answers
    3566
    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


    You may want to use the background-size CSS rule on the image component. The image is set as the background of the <div>
    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.

  9. #8
    Sencha User =NR='s Avatar
    Join Date
    Mar 2013
    Location
    Singapore
    Posts
    111
    Vote Rating
    0
    Answers
    2
    =NR= has a little shameless behaviour in the past

      0  

    Default


    Quote Originally Posted by kalor View Post
    Didn't work for me

    No matter what I do, images only appear if you set a specific height and width.

    Code:
                        {
                            xtype: 'panel',
                            layout: 'fit',
                            items: [
                                    {
                                        xtype: 'image',
                                        id: 'imgPic',
                                        hidden: false,
    //                                    flex: 1,
    //                                    width: 250,
    //                                    height: 250,
                                        src:'<snip>'
                                    }
                                    ]
                        }
    the flex property of that xtype:'image', will not have any effect unless layout property of the parent container (xtype:'panel') is either 'hbox' or 'vbox' (source)

  10. #9
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,548
    Vote Rating
    872
    Answers
    3566
    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


    No it won't but the parent does have fit layout but should remove flex, width and height configs from the image you are right about that.
    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.

  11. #10
    Sencha User =NR='s Avatar
    Join Date
    Mar 2013
    Location
    Singapore
    Posts
    111
    Vote Rating
    0
    Answers
    2
    =NR= has a little shameless behaviour in the past

      0  

    Default


    Quote Originally Posted by mitchellsimoens View Post
    No it won't but the parent does have fit layout but should remove flex, width and height configs from the image you are right about that.
    sorry, can you clarify what you mean ?