1. #1
    Sencha User
    Join Date
    Jul 2012
    Posts
    5
    Vote Rating
    0
    pixelrevision is on a distinguished road

      0  

    Default Unanswered: layout: "card" does not scale to host

    Unanswered: layout: "card" does not scale to host


    I'm not sure if this is a bug or if there is something I am missing but layout:"card" does not seem to scale the view to it's parent container.

    Here is an example:
    Code:
    Ext.define("MyApp.view.CardSandbox",{
        extend: "Ext.Panel",
        layout: "vbox",
        xtype: "cardSandbox",
        requires: [
            "Ext.TitleBar"
        ],
        config: {
            items: [
                {
                    xtype: "titlebar",
                    title: "Header"
                },
                {
                    xtype: "container",
                    layout: "card",
                    // if this is turned off then the view will not scale.
                    // setting height to 100% does nothing as well.
                    height: "300px", 
                    items: [
                        {
                            html: "Some content 1"
                        },
                        {
                            html: "Some content 2"
                        }
                    ]
                },
                {
                    xtype: "titlebar",
                    title: "Footer"
                }
            ]
        }
    });
    If height: "300px" is turned off or set to "100%" or anything besides a pixel value then the card layout will be 0 pixels high. Has anyone added a container with layout: "card" as a subview and have it successfully scale vertically?

  2. #2
    Sencha - Community Support Team sword-it's Avatar
    Join Date
    May 2012
    Location
    Istanbul
    Posts
    1,333
    Vote Rating
    85
    Answers
    124
    sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough

      0  

    Default


    Hi!

    have u checked API?

    Card Layout takes the size of the Container it is applied to and sizes the currently active item to fill the Container completely.
    it is a direct subclass of the FitLayout, the CardLayout ensures that its children conform to the size of the Container.

    so, i guess you must use height for the container on which you have embedded layout as card.

    check it out:
    http://docs.sencha.com/touch/2-0/#!/api/Ext.layout.Card
    sword-it.com, Sencha Developer House in Turkey - Istanbul University Technopark Suite 204.

  3. #3
    Sencha User bluehipy's Avatar
    Join Date
    Mar 2010
    Location
    Romania
    Posts
    618
    Vote Rating
    29
    Answers
    67
    bluehipy will become famous soon enough bluehipy will become famous soon enough

      0  

    Default


    Yes. It is possible to have "subviews" with layout card. However, except the case when the container is fullscreen or has 100% height, it needs a height or a flex, so the layout can compute a height for its children.

Thread Participants: 2

Tags for this Thread