Extjs对齐两个xtype元素

时间:2011-06-08 20:48:18

标签: extjs

您好我正在显示一个表单,其中我有一个带有一些配置输入(textField)的复选框。我怎样才能并排显示它们?下面是用ExtJS编写的代码。我很难想出一个解决方案。

{
    xtype: 'checkbox',
    fieldLabel: 'label1',
    name: 'label1',
    checked: false,
}, {
    xtype: 'textfield',
    fieldLabel: 'Config for checkbox',
    name: 'ConfigForCheckBox',
},

我真的很感激任何帮助。

谢谢,SS

2 个答案:

答案 0 :(得分:3)

试试这个:

{
    xtype       : 'compositefield'
    ,hideLabel  : true
    ,labelWidth : 100
    ,items         : [{ 
        xtype  : 'displayfield'
        ,width : 120
        ,value : 'label1'

    },{
        xtype   : 'checkbox',
        name    :'label1',
        checked : false,
        },{
        xtype  :  'displayfield'
        ,width : 20
    },{
        xtype   : 'textfield'
        ,width  : 120
        ,name   : 'ConfigForCheckBox'
    }]
}

参考: CompositeField

答案 1 :(得分:1)

快速解决方案:

创建列布局,在第二列上隐藏输入的标签。

相关问题