Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
73
rated 0 times [  80] [ 7]  / answers: 1 / hits: 7979  / 11 Years ago, mon, january 13, 2014, 12:00:00

In my UI, I have a single-select RadioGroup with a few options to choose from. One of the options will contain a textfield that the user can enter input into like this:



() Option A
() Option B
() Other (Please specify) ____


How would I add something like this to a RadioGroup?


More From » html

 Answers
4

For creating layout of Other option you can use container component with hbox layout. This component will have two items. First item will be radio and the second item will be textfield.



For creating space between radio and textfield components you can use splitter.



{
xtype: 'radiogroup',
fieldLabel: 'Choose',
columns: 1,
vertical: true,
items: [
{ boxLabel: 'Option 1', name: 'rb', inputValue: '1' },
{ boxLabel: 'Option 2', name: 'rb', inputValue: '2' },
{
xtype: 'container',
layout: 'hbox',
items: [
{
xtype: 'radio',
boxLabel: 'Other (Please specify)',
name: 'rb',
inputValue: '3'
},
{
xtype: 'splitter'
},
{
xtype: 'textfield',
name: 'option3detail'

}
]
}
]
}


Fiddle with live example: https://fiddle.sencha.com/#fiddle/2kj


[#48749] Sunday, January 12, 2014, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
lidialyrick

Total Points: 737
Total Questions: 104
Total Answers: 89

Location: Andorra
Member since Sat, May 27, 2023
1 Year ago
;