PDA

View Full Version : Setting data in checkbox group



douggiefox
22 Feb 2010, 2:39 AM
Hi

I have a checkbox group that's defined like this:




var travelUpgrades = {
xtype : 'checkboxgroup',
fieldLabel : 'Travel upgrades',
items: [{
boxLabel : 'World',
name: 'world'
},
{
boxLabel : 'Winter',
name: 'winter'
},
{
boxLabel : 'Business',
name: 'business'
}]
};



I'm trying to load some default data into it using the following:



var DefaultMember = new Ext.data.Record.create([
{
name: 'world',
type: 'boolean'
},
{
name: 'winter',
type: 'boolean'
},
{
name: 'business',
type: 'boolean'
}
]);

return new DefaultMember(
{world: false, winter: true, business: false}
);


and then calling



myForm.form.setValues(this.createDefaultMember().data);


to set the values.

It fails and I can't figure out why?

Any help is very welcome.

Best

DF