enyo:我如何编写按钮处理程序来更改另一个按钮的颜色?

发布于 2024-12-25 04:40:34 字数 749 浏览 1 评论 0原文

我试图让一个按钮的颜色在我点击另一个按钮时发生变化。我的非工作代码如下。我很难找到合适的文档

     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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

み青杉依旧 2025-01-01 04:40:34

如果您想引用您的按钮,您需要使用以下语法:

 this.$.lIqI.setStyle(ON);

If you want to refer to your button you need to use the following syntax:

 this.$.lIqI.setStyle(ON);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文