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

时间:2012-01-05 12:45:08

标签: webos 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

1 个答案:

答案 0 :(得分:2)

如果要引用按钮,则需要使用以下语法:

 this.$.lIqI.setStyle(ON);