Extjs中单选框垂直排列和水平排列

1.垂直排列方式:直接在FormPanel中用xtype:"radio"的单选框

var addForm = new Ext.FormPanel({
	frame: true,
	labelWidth: 60,
	labelAlign: "right",
	items:[
		{
			xtype:"radio",
			fieldLabel:"评价方式",
			name:"etype",
			inputValue:"1",
			boxLabel:"事前评价"
		},{
			xtype:"radio",
			name:"etype",
			inputValue:"2",
			boxLabel:"事中评价"
		},{
			xtype:"radio",
			name:"etype",
			inputValue:"3",
			boxLabel:"事后评价"
		}
	]
});

 

 

2.水平排列方式:使用RadioGroup

//1.创建radioGroup
var radioGroup = new Ext.form.RadioGroup({
	fieldLabel:"评价类型",
	width:250,
	items:[{
		layout: 'column',
		items: [
			{
				name:"etype",
				inputValue:"1",
				boxLabel:"事前评价"
			},{
				name:"etype",
				inputValue:"2",
				boxLabel:"事中评价"
			},{
				name:"etype",
				inputValue:"3",
				boxLabel:"事后评价"
			}
		]
	}]
});

//2.创建FormPanel
var addForm = new Ext.FormPanel({
	frame: true,
	labelWidth: 60,
	labelAlign: "right",
	items:[
		radioGroup
	]
});

 

 

猜你喜欢

转载自zyjustin9.iteye.com/blog/2117690