Question

i have a set of HFlexLayout('s) inside of a VFlexLayout, a vertical list of buttons(e.g., X,Y,Z) with 5 fields after each button. when a button is pressed, i want one of the fields to toggle from off to on.

{X}[0][0][0][0][0]

{Y}[1][0][0][0][0]

{Z}[1][1][1][1][0]

for the fields to be toggled (in order) by the buttons, what element is appropriate to use? I would like to be able to change the color of the field upon toggle, but these aren't buttons that need to be pressed. I would be happy with 5 blocks next to each other as long as i can set the color of each block individually.

I think I'm going to try using disabled buttons if I can set their color, or maybe a progress bar that move's 20% after each button press, but when all i want are colored blocks, each of those options feels like a hack to me.

Was it helpful?

Solution

Why not just use enyo.Control? You can the specify whatever content you want, though you might want to set the allowHTML to true if you want to put HTML in it. You can style the control however you want. You don't even need to specify the kind in this case. Assuming an HFlexBox:

 components: [
      { kind: "Button", flex: 1 },
      { content: "", flex: 1, style: "<whatever>" },
      ...

That should work out how you like it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top