Ext CheckboxGroup动态添加Checkbox方法(渲染后)

     var group = Ext.getCmp('myCheckboxGroup');      //取到对象
	var checkbox = new Ext.form.Checkbox({boxLabel: 'Item 6', name: 'cb-cust-5'});
	
	//group.items.getCount()是checkbox个数; group.panel.items.getCount()是列数;
	var col = group.panel.items.get(group.items.getCount() % group.panel.items.getCount());		
	col = group.panel.items.get(0);		//添加到第一列;
	group.items.add(checkbox);
	col.add(checkbox);
	group.panel.doLayout();


Ext CheckboxGroup动态添加Checkbox方法(渲染后)

 

 

你可能感兴趣的:(ext)