PDA

View Full Version : Checkbox Group - Aligning items automatically into multiple columns



ikchaitu
12 Jan 2015, 6:55 AM
Hi Everyone,

I am using a Checkbox group being added to a column layout as shown below

this.add(new CQ.Ext.form.CheckboxGroup({
id: 'optionsPanel',
//autoHeight: true,
//layout:'column',
//layout:'auto',
//layout: 'form',
columnWidth: .70,
border: false,
xtype: 'checkboxgroup',
vertical:true,
itemCls: 'x-check-group-alt',
height:200,
columns: 3,
items: [eval(checkBoxConfigData)]
}));

I need the items to be sliced into 3 columns automaticaly. I have mentioned the config options 'columns:3' but it doesn't split the items . Height of the container is limited to the height mentioned 200 , but the items after this height is getting hidden as shown below.



51488


Please suggest me if I need to do any changes.

Regards,
Krishna

Gary Schlosberg
12 Jan 2015, 6:16 PM
Can't see anything that would keep it form rendering in three columns. Why is the width set to .70?

ikchaitu
12 Jan 2015, 10:11 PM
Got it Fixed. :)

Issue was with items. Eval gives me array of objects and I am placing the array again in an array
like items: [eval(checkboxConfigData)] , after removing the braces its working fine

I am placing the checkbox group within a column layout, so set the column width as .70

Thanks

Gary Schlosberg
20 Jan 2015, 4:18 PM
Glad to hear you got it working, and thanks for sharing your solution with the community.