PDA

View Full Version : Checkbox group change



michaelc
5 Jan 2012, 4:36 PM
I had a 3 column check box that no longer works when I add the columns.



var group = Ext.getCmp('regionChkGroup'); //Build chcek boxes based on groups.
for (i = 0; jsonResp.regionListDataObj.length > i; ++i) {
regionItem = jsonResp.regionListDataObj[i];
var checkbox = new Ext.form.Checkbox({
boxLabel: regionItem.REGION_DESCRIPTION,
name: regionItem.REGION_ID
});
checkbox.disable();
checkbox.setValue(true);
var col = group.panel.items.get(group.items.getCount() % group.panel.items.getCount());
col.add(checkbox);
group.items.add(checkbox);
}

michaelc
5 Jan 2012, 4:39 PM
It's been simplified.
you no longer add to the column but to the component.

makes scene.


var group = Ext.getCmp('regionChkGroup'); //Build chcek boxes based on groups.
for (i = 0; jsonResp.regionListDataObj.length > i; ++i) {
regionItem = jsonResp.regionListDataObj[i];
var checkbox = new Ext.form.Checkbox({
boxLabel: regionItem.REGION_DESCRIPTION,
name: regionItem.REGION_ID
});
checkbox.disable();
checkbox.setValue(true);
group.add(checkbox);
}