Extjs4 使用ExtJSFieldContainer

Extjs4 使用ExtJSFieldContainer,extjs4,Extjs4,我想使用fieldContainer,下面是我的代码 Ext.onReady(function () { Ext.QuickTips.init(); var myViewport = new Ext.Viewport({ layout: 'border', border: false, renderTo: Ext.getBody(), items: [{ region: 'north',

我想使用fieldContainer,下面是我的代码

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

});
现在,当我运行此代码时,我无法看到文本字段或按钮


请向我推荐解决方案。

您应该在fieldset中使用fieldcontainer


并在字段集中放置布局:“hbox”。

您应该在字段集中使用fieldcontainer


并在字段集中放置布局:“hbox”。

这将替换3.4中的复合字段,这将替换3.4中的复合字段