jaffa
jaffa

Reputation: 27350

Sencha touch form panel is not showing

For some reason my form panel isn't showing. Can anyone help? I'm a newbie so sorry if this is obvious! It was build with Sencha Architect but I can't understand why no fields are showing in the form?...

Ext.define('MyApp.view.Login', {
    extend: 'Ext.Container',

    config: {
        layout: {
            type: 'vbox'
        },
        items: [
            {
                xtype: 'titlebar',
                docked: 'top',
                title: 'My Title'
            },
            {
                xtype: 'toolbar',
                docked: 'top',
                items: [

                    {
                        xtype: 'button',
                        text: 'Call'
                    },
                    {
                        xtype: 'button',
                        text: 'Email'
                    }                       
                ]
            },
            {
                xtype: 'container',
                flex: 1,
                border: 2,
                items: [
                    {
                        xtype: 'formpanel',
                        styleHtmlContent: true,
                        items: [
                            {
                                xtype: 'fieldset',
                                title: 'MyFieldSet',
                                items: [
                                    {
                                        xtype: 'textfield',
                                        label: 'Field'
                                    },
                                    {
                                        xtype: 'textfield',
                                        label: 'Field'
                                    }
                                ]
                            }
                        ]
                    }
                ]
            }
        ]
    }

});

Upvotes: 2

Views: 4184

Answers (2)

Vitalii Blagodir
Vitalii Blagodir

Reputation: 1099

To display formpanel (Ext.form.Panel) using Sencha Touch 2.3+ correctly inside other container you need to add scrollable: null property

{
    xtype: 'formpanel',
    scrollable: null,         
    items: [
        ...
    ]
}

See discussion here

Upvotes: 4

weerd2
weerd2

Reputation: 690

Change the layout of your Login view from vbox to fit. Then set the layout of the container that contains your formpanel to fit also.

Check this link for more info about layouts in Sencha Touch.

Upvotes: 2

Related Questions