【发布时间】:2021-08-27 20:32:09
【问题描述】:
我有一个复选框以及一个 boxLabel 和一个文本区域,如下所示:
xtype: 'container',
items: [{
{
xtype: 'textarea',
scrollY: true,
screenX: true,
height: 130,
minHeight: 80,
top: 10,
width: 650,
id: 'testDisplay',
name: 'testDisplay',
itemId: 'testDisplay',
bind: {
value: some text
},
listeners: {
afterrender: function(cmp) {
textAreaComp = me.down('#testDisplay');
textAreaComp.setValue(someInfo);
const myCheckBox = this.up('container').getComponent('testDisplayChkbox');
this.el.down('textarea').dom.onscroll = function () {
if (this.scrollHeight <= (this.scrollTop + this.offsetHeight)) {
myCheckBox.setDisabled(false);
myCheckBox.el.setStyle('color',red);
}
};
}
},
},
{
xtype: 'checkboxfield',
name: 'testDisplayChkbox',
id: 'testDisplayChkbox',
itemId: 'testDisplayChkbox',
checked: false,
boxLabel: someLabel,
}
]
我正在寻找复选框的轮廓和 boxLabel 的文本颜色,以根据文本区域滚动到底部时在两种颜色之间进行更改。 我曾尝试使用 cls 以及如上所示动态设置颜色,但无法更改复选框或 boxLabel 的颜色。关于如何让它发挥作用的任何建议?
【问题讨论】:
标签: javascript checkbox extjs textarea sencha-touch-2