1. #1
    Sencha User
    Join Date
    Nov 2011
    Posts
    15
    Answers
    1
    Vote Rating
    0
    Kah0ona is on a distinguished road

      0  

    Default Answered: Height of Carousel is 0, why?

    Answered: Height of Carousel is 0, why?


    Hello, I have the following component, a media carousel with a toolbar on top:
    Code:
    Ext.define('MarktBuzz.view.components.MediaCarousel', {
        extend: 'Ext.Panel',
        xtype : 'mediacarousel',
        requires: ['Ext.Toolbar', 'Ext.carousel.Carousel'],
    
    
        config: {
            fullscreen: true
        },
        
        initialize: function() {
            this.callParent(arguments);
            var toolbar, carousel;
    
            console.log("Initializing MediaCarousel");
    
            toolbar = Ext.create('Ext.Toolbar', {
            
                docked: 'top',
                title: 'Afbeeldingen',
                items: [
                    {
                        action: 'slideBack',
                        text: 'Terug',
                        ui: 'back',
                    },
                    { xtype: 'spacer'}
                ]
            });
            
           carousel = Ext.create('Ext.carousel.Carousel', {
                fullscreen: true,
            
                
                defaults: {
                    styleHtmlContent: true
                },
            
                items: [
                    {
                        html : 'Item 1',
                        style: 'background-color: #5E99CC'
                    },
                    {
                        html : 'Item 2',
                        style: 'background-color: #759E60'
                    },
                    {
                        html : 'Item 3'
                    }
                ],
    
    
            });
    
    
            this.add([toolbar, carousel]);
            console.log(this);
        },
        
    });
    The toolbar shows, but the Ext.Carousel seems to be 0px high, when inspecting the HTML. Any idea why this is the case? If I set a fixed height, it works, but if i set height like "100%" it doesn't. How can I make it to use all the vertical space?

  2. In the config object, give the panel layout : 'fit', this will tell the carousel to have 100% of the width and height and will be as you want.

  3. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    35,704
    Answers
    3356
    Vote Rating
    750
    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 the config object, give the panel layout : 'fit', this will tell the carousel to have 100% of the width and height and will be as you want.
    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
    Nov 2011
    Posts
    15
    Answers
    1
    Vote Rating
    0
    Kah0ona is on a distinguished road

      0  

    Default


    That did the trick thanks!

Thread Participants: 1

Tags for this Thread

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar