【方法一】
for(var i=0;i<obj.length;i++){
var itemsGroup = new Ext.form.CheckboxGroup({
fieldLabel:obj[i].title,
columns: obj[i].Allow.length
});
for(var j=0;j<obj[i].Allow.length;j++){
itemsGroup.add({
xtype:‘checkboxfield‘,
boxLabel: obj[i].Allow[j].text,
inputValue:obj[i].Allow[j].value
});
}
//在panel添加!
Ext.getCmp(‘manualPublish_Manage‘).add(itemsGroup);
Ext.getCmp(‘manualPublish_Manage‘).doLayout();
}
【方法二】
var unitColumns=[];
for(var i = 0;i < 4;i++){
unitColumns.push({
boxLabel: "1",
name: "1",
inputValue: "1",
checked: false
});
}
var itemsGroup = new Ext.form.CheckboxGroup({
id:‘unitItems‘,
bodyStyle:‘background-color: transparent;margin-top:10px;‘,
fieldLabel: ‘选项‘,
columns: 3,
items: unitColumns
});
Ext.getCmp(‘OptionsSet‘).add(itemsGroup);
Ext.getCmp(‘OptionsSet‘).doLayout();
!============记录点滴成长============!