1. #1
    Sencha User
    Join Date
    Feb 2011
    Posts
    111
    Answers
    5
    Vote Rating
    0
    sissonb is on a distinguished road

      0  

    Default Unanswered: Layout engine changes from 2.0.2 to 2.1.1

    Unanswered: Layout engine changes from 2.0.2 to 2.1.1


    Hey, I just upgraded my Sencha touch library to 2.1.1 from 2.0.2. Looks like there was another major layout engine change.

    I've noticed my Ext.form.Panel are no longer filling their container. How do I implement the following layout with sencha touch 2.1.1,

    In Sencha touch 2.0.2 this layout looks like this,
    http://screencast.com/t/u0oO5hoktAQ

    In Sencha touch 2.1.1 this layout looks like this,
    http://screencast.com/t/kEo64X5bk

    This is a simple example, but this issue is reoccurring in other places with a dynamic number of items. I cannot just add a static height to the form elements because of this.

    Code:
    Ext.define('app.view.login.LogoPanel', {
        extend:'Ext.Panel',
        alias:['widget.logopanel'],
        config:{
            margin:'10 0 0 0',
            items:[
                {
                    html:"<p class='logo-image'></p>"
                }
            ]
        }
    });
    Code:
    Ext.define('app.view.login.LoginForm', {
        extend:'Ext.form.Panel',
        alias:['widget.loginform'],
        config:{
            scrollable:false,
            padding:10,
            items:[
                {
                    xtype:'textfield',
                    placeHolder:'Username',
                    name:'username'
                },
                {
                    xtype:'passwordfield',
                    placeHolder:'Password',
                    name:'password'
                },
                {
                    xtype:'button',
                    text:'Login',
                    itemId:'login'
                }
            ]
        },
        constructor:function (config) {
            this.callParent(arguments);
        }
    });
    Code:
    Ext.define('app.view.login.Panel', {    extend:'Ext.Panel',
        alias:['widget.loginpanel'],
        config:{
            fullscreen:true,
            scrollable:true,
            items:[
                {
                    xtype:'toolbar',
                    docked:'top',
                    title:'Login',
                    items:[
                        {
                            xtype:'container',
                            flex:1
                        }
                    ]
                },
                {
                    xtype:'logopanel'
                },
                {
                    xtype:'loginform',
                    flex:1
                },
                {
                    xtype:'container',
                    flex:1
                }
            ]
        },
        constructor:function (config) {
            this.callParent(arguments);
        }
    });

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


    The DOM for a form has changed quite a bit, you need to use a layout manager like vbox on your app.view.login.Panel component.
    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.

  3. #3
    Sencha User
    Join Date
    Feb 2011
    Posts
    111
    Answers
    5
    Vote Rating
    0
    sissonb is on a distinguished road

      0  

    Default


    Quote Originally Posted by mitchellsimoens View Post
    The DOM for a form has changed quite a bit, you need to use a layout manager like vbox on your app.view.login.Panel component.
    Hey Mitchell, I've tried playing with the layouts for awhile last Friday and I am continuing today. When I add a vbox layout the overflow is hidden like this, http://screencast.com/t/FxVSqxcQ

    I will keeping fighting the layout manager, but any suggestions are welcome.

    Thanks

Thread Participants: 1

Tags for this Thread