1

我试图让一个按钮的颜色在我点击另一个按钮时改变。我的非工作代码如下。我很难找到正确的文档

     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
4

1 回答 1

2

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

 this.$.lIqI.setStyle(ON);
于 2012-01-05T21:00:31.413 回答