2011-06-08 63 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

快速的解決方案:

創建列布局和第二列隱藏標籤您的輸入。