简体   繁体   English

禁用:'{readOnly}'是什么意思ExtJs

[英]disabled: '{readOnly}' what's mean ExtJs

I'm working on a project in ExtJS started by my colleagues. 我正在研究由同事ExtJS项目。 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}' ? disabled: '{readOnly}'什么disabled: '{readOnly}' According to documentation, disabled: should be a boolean, so disabled: '{readOnly}' what is supposed to be? 根据文档, disabled:应该为布尔值,因此disabled: '{readOnly}'应该是什么?

Disabled and ReadOnly tags are very similar but have some noticeable differences. DisabledReadOnly标签非常相似,但有一些明显的区别。 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. readOnly在提交时提交字段。 In this case, since readOnly is used alongside disabled , the functionality remains the same ie user can't trigger the field and it is not submitted so it is equivalent to: 在这种情况下,由于readOnlydisable一起使用,因此功能保持不变,即用户无法触发该字段并且不提交该字段,因此等效于:

 disabled: true 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM