Ext checkBoxGroup的用法和取值

Ext.onReady(function(){
			var myCheckboxGroup = new Ext.form.CheckboxGroup({ 
			    id:'myGroup', 
			    xtype: 'checkboxgroup', 
			    renderTo :'form-cb',
			    fieldLabel: 'Single Column', 
			    itemCls: 'x-check-group-alt', 
			    columns: 3, 
			    items: [ 
			        {boxLabel: '唱歌', name: '1'}, 
			        {boxLabel: '游泳', name: '2', checked: true}, 
			        {boxLabel: '看书', name: '3'},
			        {boxLabel: '旅游', name: '4'},
			        {boxLabel: '游戏', name: '5'},
			        {boxLabel: '睡觉', name: '6'} 
			    ] 
			}); 
			
			//CheckboxGroup取值方法
			for (var i = 0; i < myCheckboxGroup.items.length; i++)
			{
				if (myCheckboxGroup.items.itemAt(i).checked)
				{
					alert(myCheckboxGroup.items.itemAt(i).name);				
				}
			}
		});

 

你可能感兴趣的:(游戏,ext,旅游)