enyo:我如何编写按钮处理程序来更改另一个按钮的颜色?
我试图让一个按钮的颜色在我点击另一个按钮时发生变化。我的非工作代码如下。我很难找到合适的文档
components: [
{flex: 1,
kind: "Control",
layoutKind: "HFlexLayout",
components: [
{kind: "Button", caption: "X", onclick: "buttonClick", style: Xcolor},
{name: "lIqI", kind: "Button", caption: "I", disabled: true, style: OFF},
{kind: "Button", caption: "II", disabled: true, style: OFF},
{kind: "Button", caption: "III", disabled: true, style: OFF},
{kind: "Button", caption: "IV", disabled: true, style: OFF},
{kind: "Button", caption: "V", disabled: true, style: OFF}
],
buttonClick: function(inSender, inEvent) {
lIqI.setStyle(ON);
}
// ON & OFF are colors
i'm trying to get the color of one button to change whenever i click on a different button. My non working code is below. I've had trouble finding the right documentation for this
components: [
{flex: 1,
kind: "Control",
layoutKind: "HFlexLayout",
components: [
{kind: "Button", caption: "X", onclick: "buttonClick", style: Xcolor},
{name: "lIqI", kind: "Button", caption: "I", disabled: true, style: OFF},
{kind: "Button", caption: "II", disabled: true, style: OFF},
{kind: "Button", caption: "III", disabled: true, style: OFF},
{kind: "Button", caption: "IV", disabled: true, style: OFF},
{kind: "Button", caption: "V", disabled: true, style: OFF}
],
buttonClick: function(inSender, inEvent) {
lIqI.setStyle(ON);
}
// ON & OFF are colors
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您想引用您的按钮,您需要使用以下语法:
If you want to refer to your button you need to use the following syntax: