2011-06-08 51 views
2

嗨我正在显示一个表单,其中有一些配置输入(textField)复选框。我怎样才能并排显示它们?以下是用ExtJS编写的代码。我有一些难以想出的解决方案。Extjs对齐两个xtype元素

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

我真的很感激任何帮助。

感谢,SS

+0

心灵尾随逗号...... – Chau 2011-06-09 07:11:15

回答

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

快速的解决方案:

创建列布局和第二列隐藏标签您的输入。