ExtJs之Radio和CheckBox实例

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
	<meta charset="utf-8" />
    <link href="Ext4.2/resources/css/ext-all.css" rel="stylesheet" />
    <script src="Ext4.2/bootstrap.js"></script>
    <script>
        Ext.onReady(function () {
            new Ext.form.Panel({
                title: 'Ext.form.field.checkbox和Ext.form.field.Radio实例',
                bodyStyle: 'pading:5 5 5 5',// 表单边距
                frame: true,
                height: 350,
                width: 350,
                renderTo: 'form',
                defaults: { //统一设置表单字段默认属性
                    labelSeparator: ':',//分隔符
                    labelWidth: 80, //标签宽度
                    width: 200, //字段宽度
                    labelAlign:'left' //标签对齐方式

                },
                items: [{
                    xtype: 'radio',
                    name: 'sex',
                    fieldLabel: '性别',
                    boxLabel:'男'
                },
                {
                    xtype: 'radio',
                    name: 'sex',
                    fieldLabel: '性别',
                    boxLabel: '女'
                },
                {
                    xtype: 'checkboxfield',
                    name: 'swim',
                    fieldLabel: '爱好',
                    boxLabel: '游泳'
                },
                {
                    xtype: 'checkboxfield',
                    name: 'walk',
                    fieldLabel: '爱好',
                    boxLabel: '散步'
                },
                {
                    xtype: 'radiogroup',
                    fieldLabel: '性别',
                    columns: 2,
                    items: [
                        { boxLabel: '男', name: 'sex', inputValue: 'male' },
                        { boxLabel: '女', name: 'sex', inputValue: 'female' }
                    ]
                },
                {
                    xtype: 'checkboxgroup',
                    fieldLabel: '爱好',
                    columns: 3,
                    items: [
                        { boxLabel: '游泳', name: 'swim' },
                        { boxLabel: '散步', name: 'walk' },
                        { boxLabel: '阅读', name: 'read' },
                        { boxLabel: '游戏', name: 'game' },
                        { boxLabel: '电影', name: 'movie' }
                    ]
                }
                ]
            });
        })
    </script>
</head>
<body>
     <form id="form"></form>
</body>
</html>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值