PDA

View Full Version : Radio Button Group



lindasingini
19 Apr 2011, 1:50 AM
I have a radio button group with just 2 radio buttons. I need to update the value of the radio buttons using submitted information in the database. How do i set the value of the radio buttons. By value in this case i mean the checked state.Thank you.

raj_plays
19 Apr 2011, 3:42 AM
your form will have:


{
xtype: 'radiogroup',
id: 'frequency',
items:
[
{boxLabel: 'Option 1', name: 'frequency', inputValue: 1, checked: true},
{boxLabel: 'Option 2', name: 'frequency', inputValue: 2}
]
}


After the form is rendered, do
form.findField('frequency').setValue(record.data.frequency);

Your record should have frequency defined as..
{name: 'frequency', type: 'int'}