enyo: how do i write a button handler to change the color of another button?

StackOverflow https://stackoverflow.com/questions/8749741

  •  14-04-2021
  •  | 
  •  

質問

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
役に立ちましたか?

解決

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

 this.$.lIqI.setStyle(ON);
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top