Question

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
Was it helpful?

Solution

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

 this.$.lIqI.setStyle(ON);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top