Quantcast
Channel: Northwoods Software - Latest topics
Viewing all articles
Browse latest Browse all 7421

Change color button background

$
0
0

@Ale9582 wrote:

i'm little new with go js and i don't understand how, is its possible, i can change a color button background or just the shape inside it,

my proble is assing to a node the color shape but i don't understand how

my button (inside a node)

            $("Button",{click: changeColor},
              $(go.Shape,
                { fill:  'red', stroke: null, desiredSize: new go.Size(20, 20) },
                new go.Binding("fill", "color").makeTwoWay()
              )

this is my function

function changeColor(button) {
  var node = button.part.adornedPart;

  var shape = node.findObject("SHAPE");

  node.diagram.startTransaction("Change color");

  shape.fill = button.shape.fill; //<- doesnt work

  node.diagram.commitTransaction("Change color");
};

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 7421

Trending Articles