As i said i need to align checkboxes .... so this is how i want thing to be .....
var items = new Ext.util.MixedCollection();
for (var i = 0; i < countryArray.length; i++) {
var item = countryArray[i];
var countryCheckbox=new Ext.form.Checkbox({
id:item.id,
boxLabel: item.countryName,
checked: item.enabled,
listeners: {check: fn:function here.... });
items.add(countryCheckbox);
}
Ext.getCmp("MCP").insert(0,new Ext.form.CheckboxGroup({
width: 520,
columns: 3,
vertical: true,
items: items
}));
Here in does not add items gives error
this.items[0] is undefined
Previously i was adding array of items insted of MIXED COLLECTION but it didnt took my checkbox listener so i hv to change it to mixed collection
thisItem = new Array();
thisItem["boxLabel"] = item.countryName;
thisItem["id"] = item.id;
thisItem["checked"]=item.enabled;
thisItem["listeners"]={check: {fn: countCountriesSelected(thisItem,thisItem.checked)}};
countryDataArray.push(thisItem);
This array was added but the check listener didnt worked it gave me error