2
votes

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'
                                    }
                                ]
                            }
                        ]
                    }
                ]
            }
        ]
    }

});
2

2 Answers

2
votes

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.

4
votes

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