ExtJs之单选及多选框

简介:

坚持 

复制代码
<!DOCTYPE html>
<html>
<head>
    <title>ExtJs</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <link rel="stylesheet" type="text/css" href="ExtJs/packages/ext-theme-crisp/build/resources/ext-theme-crisp-all.css">
        <script type="text/javascript" src="ExtJs/ext-all.js"></script>
        <script type="text/javascript" src="ExtJs/bootstrap.js"></script>
        <script type="text/javascript" src="ExtJs/packages/ext-theme-crisp/build/ext-theme-crisp.js"></script>
        
    <script type="text/javascript">
            Ext.onReady(function(){
                new Ext.form.Panel({
                    title: 'Ext.form.field.Checkbox and Radio Sample',
                    bodyStyle: 'padding: 5 5 5 5',
                    frame: true,
                    height: 150,
                    width: 250,
                    renderTo: 'form',
                    defaults: {
                        labelSeparator: ':',
                        labelWidth: 80,
                        width: 200,
                        labelAlign: 'left'
                    },
                    items: [{
                        xtype: 'radio',
                        name: 'sex',
                        fieldLabel: 'sex',
                        boxLabel: 'male'
                    },{
                        xtype: 'radio',
                        name: 'sex',
                        fieldLabel: 'sex',
                        boxLabel: 'femail'
                    },{
                        xtype: 'checkboxfield',
                        name: 'swim',
                        fieldLabel: 'hobby',
                        boxLabel: 'swim'
                    },{
                        xtype: 'checkboxfield',
                        name: 'walk',
                        fieldLabel: 'hobby',
                        boxLabel: 'walk'
                    }]
                });
                
                new Ext.form.Panel({
                    title: 'Ext.form.field.Checkbox and Radio Sample',
                    bodyStyle: 'padding: 5 5 5 5',
                    frame: true,
                    height: 200,
                    width: 270,
                    renderTo: 'form1',
                    defaults: {
                        labelSeparator: ':',
                        labelWidth: 50,
                        width: 200,
                        labelAlign: 'left'
                    },
                    items: [{
                        xtype: 'radiogroup',
                        fieldLabel: 'sex',
                        columns: 2,
                        items: [
                            {boxLabel: 'male', name: 'sex', inputValue: 'male'},
                            {boxLabel: 'female', name: 'sex', inputValue: 'female'}
                        ]
                    },{
                        xtype: 'checkboxgroup',
                        fieldLabel: 'hobby',
                        columns: 3,
                        items: [
                            {boxLabel: 'swim', name: 'swim'},
                            {boxLabel: 'walk', name: 'walk'},
                            {boxLabel: 'read', name: 'read'},
                            {boxLabel: 'game', name: 'game'},
                            {boxLabel: 'movie', name: 'movie'}
                        ]
                    }]
                });
            });
    </script>
</head>
<body>
    <div id='form'></div>
        <div id='form1'></div>


</body>
</html>
复制代码

目录
相关文章
|
2月前
|
JavaScript
原生js实现复选框(全选/全不选/反选)效果【含完整代码】
原生js实现复选框(全选/全不选/反选)效果【含完整代码】
57 1
|
6月前
|
JavaScript 前端开发 Java
19jqGrid - 多选
19jqGrid - 多选
22 0
|
1月前
《vue3实战》运用radio单选按钮或Checkbox复选框实现单选多选的试卷制作
《vue3实战》运用radio单选按钮或Checkbox复选框实现单选多选的试卷制作
|
5月前
全选或者单选checkbox的值动态添加到div
全选或者单选checkbox的值动态添加到div
26 0
|
4月前
|
JavaScript 前端开发
JS单选全选全不选
JS单选全选全不选
15 0
|
4月前
表单单选框,多选框美化
之前总是匆匆看过,如今终于知道该怎么搞了。。。 **利用label挂钩checkbox的特点来实现。 当html代码中,label的for属性值和checkbox的id值一样的时候,label就可以控制checkbox的选择了。
19 0
|
5月前
复选框checkbox实现自定义样式
复选框checkbox实现自定义样式
26 1
|
5月前
layui的复选框怎么设置只能单选
layui的复选框怎么设置只能单选
|
6月前
49zTree - 带 checkbox 的多选下拉菜单
49zTree - 带 checkbox 的多选下拉菜单
23 0
|
6月前
50zTree - 带 radio 的单选下拉菜单
50zTree - 带 radio 的单选下拉菜单
21 1

热门文章

最新文章