0

I'm working on a project in ExtJS started by my colleagues. I found an item of a fieldset which is like this:

{
    xtype: 'radiofield',
    name: 'something',
    value: something,
    label: something,
    checked: something,
    bind: {
        disabled: '{readOnly}'
    }
}

What is disabled: '{readOnly}' ? According to documentation, disabled: should be a boolean, so disabled: '{readOnly}' what is supposed to be?

Sandy.....
  • 2,833
  • 2
  • 15
  • 26
  • 1
    Check this [documentation](https://docs.sencha.com/extjs/6.5.2/index.html). `disabled: '{readOnly}'` this will disabled your component based on your readonly value and this `readOnly` values is comes from viewmodel. So please read about extjs documentation and if your are using binding then also read about the same. – Narendra Jadhav Oct 25 '18 at 16:30

1 Answers1

-1

Disabled and ReadOnly tags are very similar but have some noticeable differences. The "Disabled" tag is used to ensure the user cannot trigger or alter the field and Field isn't sent when submit is clicked. Whereas readOnly submits the field on submit. In this case, since readOnly is used alongside disabled, the functionality remains the same i.e. user can't trigger the field and it is not submitted so it is equivalent to:

disabled: true
afkhero
  • 16
  • 1
  • 5
  • But what mean the notation '{...}' ? – Cristina Moretti Oct 25 '18 at 13:54
  • standard notation for variables? – afkhero Oct 25 '18 at 15:48
  • 1
    `{text}` means that it is retrieving the value of `text` from the viewmodel for that view. This viewmodel may be on this view or any parent up the chain and can refer to either a simple data value or a boolean. Recommend reading up on viewmodels in the docs - they're very useful. – Matt Allwood Oct 29 '18 at 10:40