ext ratio

Ext.form.Radio的横向和纵向排列
2007-11-29 10:33

横向:整个Radio Group使用column方式进行布局即可横向显示,但这样的话只能显示每一个Radio的BoxLabel,不能为Radio Group指定一个总的Label,所以第一个Radio再使用form布局进行嵌套,用它的fieldLabel作为Radio Group的Label.

纵向:使用Form进行布局即可,但除了第一项之外的所有项需要把labelSeparator指定为空,以免出现多余的冒号。

效果图

配置代码

new Ext.FormPanel({
labelAlign: 'right',
frame:true,
title: 'Radio Group',
bodyStyle:'padding:5px 5px 0',
width: 400,
items: [
{
layout:'column',
items:[
{
layout: 'form',
items: [new Ext.form.Radio({fieldLabel: '横向Radio Group',boxLabel:'opt1', name:'opt1'})]
},
{items: [new Ext.form.Radio({boxLabel:'opt2', name:'opt1'})]},
{items: [new Ext.form.Radio({boxLabel:'opt3', name:'opt1'})]},
{items: [new Ext.form.Radio({boxLabel:'opt3', name:'opt1'})]}
]
},
{
layout: 'form',
items: [
new Ext.form.Radio({fieldLabel: '纵向Radio Group',boxLabel:'opt1', name:'opt2'}),
new Ext.form.Radio({boxLabel:'opt2',labelSeparator:'', name:'opt2'}),
new Ext.form.Radio({boxLabel:'opt3',labelSeparator:'', name:'opt2'}),
new Ext.form.Radio({boxLabel:'opt3',labelSeparator:'', name:'opt2'})
]
}
]
});
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值