ExtJS FieldSet fieldLabel不在FormPanel中显示

时间:2011-02-04 20:49:13

标签: extjs

我有一个带有多个文本字段项的FormPanel和一个包含组合框和按钮的字段集。字段集具有列布局,以使组合框和按钮并排显示。但是,即使字段集位于FormPanel内,也不会显示该字段集的字段标签。当我创建fieldset的布局表单时,只显示标签分隔符。为什么会这样?是否有更好的方法来获得具有多个文本字段的表单,然后是并排的组合框和按钮?

这就是我所拥有的:

this.searchPanel = new Ext.FormPanel({
    border: false,
    frame: true,
    style:  'width:50%',
    bodyStyle: 'padding:6px 10px 0px 10px',
    items: [{
        //Several textfields
        },{
            xtype: 'fieldset',
            border: false,
            autoHeight: true,
            fieldLabel: 'Sort by',
            labelStyle: 'font-weight: normal',
            style: 'padding:0;margin-bottom:0',
            layout: 'column',
            items: [
                {
                    xtype: 'combo',
                    name: 'sort',
                    style: 'width:100%',
                    columnWidth: .5,
                    hiddenName: 'sort',
                    store: //Commented out for brevity
                    mode: 'local',
                    editable: false,
                    forceSelection: true,
                    triggerAction: 'all'
                },{
                    xtype: 'button',
                    style: 'margin-left: 10px',
                    columnWidth: .5
                }
            ]
        }
    ]
});

1 个答案:

答案 0 :(得分:4)

FieldSet没有像其他表单组件一样的fieldLabel,而是像面板一样拥有标题。