Threaded View

  1. #1
    Sencha User
    Join Date
    Jul 2012
    Posts
    12
    Vote Rating
    0
    Answers
    1
    Dano_Cuba is on a distinguished road

      0  

    Default Answered: formpanel within fieldset not working...

    Answered: formpanel within fieldset not working...


    Hi all.

    I'm trying to put a radio button, but it's not working to me. I used a formpanel like documentation show to radio field, but when i try to see it in a fieldset, i see the other field but not the radio buttons.

    Any body can tell me what is wrong in my code:

    Code:
    Ext.define('MyFirstSencha.view.Contact', {
        extend:'Ext.form.FieldSet',
        xtype: 'contactform',
        
        config:{
            title: 'Contact',
            layout : 'vbox',
            iconCls: 'user',
    
    
            items: [
                {
                    xtype: 'textfield',
                    name: 'name',
                    label: 'Name'    
                },
                {
                    xtype: 'emailfield',
                    name: 'email',
                    label: 'Email'    
                },
                {
                    xtype: 'textareafield',
                    name: 'message',
                    label: 'Message'    
                },
                {
                    xtype: 'formpanel',
                    config: { 
                        title: 'Radios',
                        layout: 'vbox',                    
                        items: [
                                    {
                                        xtype: 'radiofield',
                                        name : 'color',
                                        value: 'red',
                                        label: 'Red',
                                        checked: true
                                    },
                                    {
                                        xtype: 'radiofield',
                                        name : 'color',
                                        value: 'green',
                                        label: 'Green'
                                    },
                                    {
                                        xtype: 'radiofield',
                                        name : 'color',
                                        value: 'blue',
                                        label: 'Blue'
                                    }
                                ]
                    }
                }
            ]
        }
    });
    I tried wtith differents layout but nothing changes!!

  2. Didn't notice that config object, that was an issue. This works for me:

    Code:
    Ext.define('MyFirstSencha.view.Contact', {
        extend : 'Ext.form.FieldSet',
        xtype  : 'contactform',
    
        config : {
            title   : 'Contact',
            layout  : 'vbox',
            iconCls : 'user',
    
            items : [
                {
                    xtype : 'textfield',
                    name  : 'name',
                    label : 'Name'
                },
                {
                    xtype : 'emailfield',
                    name  : 'email',
                    label : 'Email'
                },
                {
                    xtype : 'textareafield',
                    name  : 'message',
                    label : 'Message'
                },
                {
                    xtype  : 'formpanel',
                    flex   : 1,
                    title  : 'Radios',
                    items  : [
                        {
                            xtype   : 'radiofield',
                            name    : 'color',
                            value   : 'red',
                            label   : 'Red',
                            checked : true
                        },
                        {
                            xtype : 'radiofield',
                            name  : 'color',
                            value : 'green',
                            label : 'Green'
                        },
                        {
                            xtype : 'radiofield',
                            name  : 'color',
                            value : 'blue',
                            label : 'Blue'
                        }
                    ]
                }
            ]
        }
    });