PDA

View Full Version : How to dynamically add checkboxgroup in a form panel



nill_tuhin
16 May 2011, 12:24 AM
Hi,
I am so tired to dynamically add checkboxgroup in formpanel.
Please help me.


Thanks
Tuhin

grgur
16 May 2011, 11:29 AM
Just add your checkboxgroup or any other field/set of fields, followed by doLayout()

e.g.:


var newCheckBoxGroup = {
xtype: 'checkboxgroup',
fieldLabel: 'New cbgroup',
items: [{
columnWidth: '.6',
items: [
{xtype: 'label', text: 'Heading 1'},
{boxLabel: 'Item 1', name: 'cb1'},
{boxLabel: 'Item 2', name: 'cb2'}
]
},{
columnWidth: '.4',
items: [
{xtype: 'label', text: 'Heading 2'},
{boxLabel: 'Item 3', name: 'cb3'}
]
}]
}

var fp = new Ext.FormPanel({...});
/* ... business logic ... */

fp.add(newCheckBoxGroup);
fp.doLayout();