mikeb
mikeb

Reputation: 727

Displaying radio-fields in extjs

I have two radio button options, that one of it has next to it a textfield. The radiofield with the textarea next to it are showing. However the first radiofield (small) isn't showing. Any help on why?

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'

            }
            ]
    });

Upvotes: 1

Views: 51

Answers (1)

Tarabass
Tarabass

Reputation: 3152

Put a container around the hbox. You are now override the first items array with the second items array. You can only have one items array per container/wrapper.

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'
        }]
    }
});

Upvotes: 1

Related Questions