Quantcast
Channel: GoJS - Northwoods Software
Viewing all articles
Browse latest Browse all 7069

Color links based on attribule on node

$
0
0

@idekkers wrote:

I have nodes, that at a certain point I add a "dead"=true attribute to,
when I do that, I want to change the stroke color of all the link connected to it,
I have this for the link template:

$(go.Shape, { isPanelMain: true, strokeWidth: 2 },
new go.Binding("stroke", "fromNode", function(n) { return n.data.dead ? "red" : "black"; }).ofObject(),
new go.Binding("stroke", "toNode", function(n) { return n.data.dead ? "red" : "black"; }).ofObject(),
new go.Binding("stroke", "isHighlighted", function (h) { return h ? "violet" : "black"; }).ofObject())

the highlight works perfectly, but when I add the dead attribute, nothing happens?
any ideas?

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 7069

Trending Articles