在extjs中显示无线电字段

时间:2015-09-24 19:30:34

标签: javascript extjs

我有两个单选按钮选项,其中一个选项旁边有一个文本字段。显示旁边有textarea的无线电场。然而,第一个无线电场(小)并没有显示出来。有什么帮助吗?

size= Ext.create('Ext.form.Panel', {
            xtype: 'fieldset',
            flex: 1,
            defaultType: 'radio', 
            width:'100%',
            border:false,

            items: {
                checked: true,
                boxLabel: 'Small',
                name: 's',
                inputValue: 'small',

           },

            layout: 'hbox',
            items: [
            {
                boxLabel: 'Large',
                name: 's',
                inputValue: 'l',
            },
            {
                    xtype: 'splitter'
            },                            
            {
                    xtype: 'textfield',
                    name: 'specify'

            }
            ]
    });

1 个答案:

答案 0 :(得分:1)

在hbox周围放一个容器。您现在使用第二个items array覆盖第一个items array。每个容器/包装器只能有一个items array

size= Ext.create('Ext.form.Panel', {
    xtype: 'fieldset',
    flex: 1,
    defaultType: 'radio', 
    width:'100%',
    border:false,
    items: {
        checked: true,
        boxLabel: 'Small',
        name: 's',
        inputValue: 'small'
    }, {
        xtype: 'container',
        layout: 'hbox',
        items: [
        {
            boxLabel: 'Large',
            name: 's',
            inputValue: 'l',
        },
        {
            xtype: 'splitter'
        },                            
        {
            xtype: 'textfield',
            name: 'specify'
        }]
    }
});