`

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
	]
});

 

 

  • 大小: 1.7 KB
  • 大小: 1.3 KB
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics