4

There are some days that I'm trying to build a code that allows binding a radiogroup.

However, despite efforts, I have not succeed.

What is missing in my code?

Can you help me, please?

Fiddle:

https://fiddle.sencha.com/#fiddle/bao

jose
  • 1,490
  • 3
  • 30
  • 65

2 Answers2

5

You'll need to inspect the radio group once the value has change and in a ViewModel formula you need to find the first checked value and return is boxLabel. See your altered fiddle here

Gabriel Kohen
  • 4,166
  • 4
  • 31
  • 46
  • Glad to hear @josei please accept the answer and vote accordingly if you feel you can use this. Thanks! – Gabriel Kohen Dec 14 '14 at 17:31
  • Thanks again. I try to vote before, but i`m a begginer and unfortunately vote up requires 15 reputation. – jose Dec 14 '14 at 19:50
  • In newer ExtJS versions (not sure but probably since 6) you solve this issue by simply adding the following config to the radiogroup: ```simpleValue: true``` – John Smith Jun 20 '21 at 18:14
0

I got below less codes. In this method, two components are connected with less codes.

{
    xtype: 'radiogroup',
    reference: 'startTimerEndType',
    publishes: 'value',
    fieldLabel: 'Test',
    columns: 1,
    vertical: true,
    items: [
        {boxLabel: 'One', name: 'box', inputValue: '1', checked: true},
        {boxLabel: 'Two', name: 'box', inputValue: '2'},
        {boxLabel: 'Three', name: 'box', inputValue: '3'},
    ]
},{
    xtype: 'numberfield',  
    hidden: true,
    bind: {
        visible: "{startTimerEndType.value.box==3}"
    },
}

omid
  • 400
  • 3
  • 19