mahesh
mahesh

Reputation: 4763

Using ExtJS fieldContainer

I want to use fieldContainer below is my code for that..

Ext.onReady(function () {
    Ext.QuickTips.init();


    var myViewport = new Ext.Viewport({
        layout: 'border',
        border: false,
        renderTo: Ext.getBody(),
        items: [{
            region: 'north',
            xtype: 'panel',
            id: 'north-panel',
            border: false,
            height: 125
        }, {
            region: 'center',
            xtype: 'panel',
            id: 'center-panel',
            border: false,
            items: [{
                xtype: 'fieldcontainer',
                fieldLabel: 'Time worked',
                combineErrors: false,
                layout: 'hbox',
                defaults: {
                    flex: 1,
                    hideLabel: true
                },
                items: [{
                    name: 'hours',
                    xtype: 'textfield',
                    width: 48,
                    allowBlank: false
                }, {
                    name: 'minutes',
                    xtype: 'button',
                    width: 10,
                    text: 'add'
                }]
            }]
        }]
    });

});

Now when I run this code I am not able to see textfield or button.

Suggest me the solution please.

Upvotes: 0

Views: 5057

Answers (1)

Kunal
Kunal

Reputation: 1024

You should use fieldcontainer within fieldset.

And put layout: 'hbox' in the fieldset.

Upvotes: 5

Related Questions