简体   繁体   English

如何使禁用的文本字段上的文本清晰可见

[英]How to make text on disabled textfield clear

I created a form using extjs4 where there are some textfields. 我使用存在一些文本字段的extjs4创建了一个表单。 I wonder if is it possible to make the text inside the textfields more "black" or clear when the textfield is disabled? 我想知道是否可以在禁用文本字段时使文本字段内的文本更“黑”或清除? And if it is possible, how do I do it? 如果有可能,我该怎么办? I searched the api but I can't seem to find the answer. 我搜索了api,但似乎找不到答案。 When it is disabled, I cant hardly read the text inside it. 禁用该功能后,我几乎无法阅读其中的文字。

Disabled fields get the x-item-disabled class added (you can change it by passing disabledCls ). 禁用字段会添加添加的x-item-disabled类(您可以通过传递disabledCls进行更改)。
You can change it in your theme (_core.scss) or css. 您可以在主题(_core.scss)或CSS中进行更改。

For example: http://jsfiddle.net/8mjvg/1/ 例如: http : //jsfiddle.net/8mjvg/1/

.x-item-disabled {
    .-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=80)";
    .filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80);
    opacity: 0.8;
}  

.x-item-disabled .x-form-field {
    color: red;
}

Alternatively, you can use the disable & enable events to change the field style. 或者,您可以使用disableenable事件来更改字段样式。

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

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