PDA

View Full Version : Get the value of boxLabel for selected Radio buton in RadioGroup



sachindhake
14 Jun 2011, 7:12 AM
Very tiny issue, but not getting any idea how to go about it. Please Help !!!

Consider below Radio group:


{ fieldLabel: 'Control', id: 'ControlType', hiddenName: 'ControlType', xtype: 'radiogroup'
items: [
{ boxLabel: 'X-Control', name: 'rb-ControlType', inputValue: 'XXXXX' },
{ boxLabel: 'Y-Control', name: 'rb-ControlType', inputValue: 'YYYYY' }
]
}


What I want is to retrieve BOTH values of the SELECTED radio i.e. boxLabel and inputValue.

I can get the value of inputValue property using getValue() method, but how to retrieve the value of boxLabel for the same.

Any idea or suggestions ? Or any other way to get more than 2 values for the same scenario.

Thanks in advance.

skirtle
16 Jun 2011, 11:33 AM
Please use code tags when posting code examples (# button on the toolbar).

You can get to the label with radio.boxLabel, but you shouldn't be trying to retrieve this label in the first place. The value returned by getValue() should uniquely identify the entry within your data model and if you need the boxLabel for something else you should grab it from that entry.