radio

function stepOne()
{
  
var formPanel = Ext.create('Ext.form.Panel', {
     id:'form',
        bodyPadding: 5,
        fieldDefaults:
        {
            labelAlign: 'left',
            labelWidth: 100,
            anchor: '100%'
        },
        items: [
        {
        id:'radio1',
            xtype: 'radiofield',
            name: 'create_from',
            inputValue: 1,
            boxLabel: 'Quick Launch From Tempalte'
        },
        {
            xtype: 'textareafield',
            width: 500,
            value:'Quick Launch From Tempalte explain'
        },
        {
        id:'radio2',
            xtype: 'radiofield',
            name: 'create_from',
            inputValue: 2,
            fieldLabel: '',
            labelSeparator: '',
            boxLabel: 'Quick Launch From Image'
        },
        {
            xtype: 'textareafield',
            width: 500,
            value:'Quick Launch From Image explain'
        },
        {
        id:'radio3',
            xtype: 'radiofield',
            name: 'create_from',
            inputValue: 3,
            fieldLabel: '',
            labelSeparator: '',
            boxLabel: 'Quick Launch From User'
        },
        {
            xtype: 'textareafield',
            width: 500,
            value:'Quick Launch From User explain'
        },
        {
                xtype: 'button',
                columnWidth:.1,
                formBind: true,
                disabled: true,
                text: 'Net Step',
                width: 120,
                handler: function()
                {
                    var form = this.up('form').getForm();
                    var radio1 = Ext.getCmp('radio1');
                    var craeteFrom = radio1.getGroupValue();//radio取已经选中的值
                    if (null == craeteFrom)
                    {
                    Ext.Msg.alert('one step','please choose the launch way');
                    }else{
                    stepTwo();
                    }
                }
        }
        ]
    });

var win = Ext.widget('window', {
        title: 'Launch Instance',
        closeAction: 'hide',
        layout: 'fit',
        resizable: true,
        modal: true,
        items: formPanel
    });
   
   win.show();

}

你可能感兴趣的:(Radio)