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

Bind user defined color on Highlight

$
0
0

@vishal_prabhu81 wrote:

Hi,

I am currently looking at the sample #4 in the dataBinding page of GoJs
http://gojs.net/latest/intro/dataBinding.html

Here on highlight, Color is set to pink and when highlight is set to false it is set to LightBlue.
new go.Binding("fill", "highlight", function(v) { return v ? "pink" : "lightblue"; }),

What I am trying to achieve is to set User defined color rather than hardcoding the value in the function
new go.Binding("fill", "highlight", function(v) { return v ? "pink" : "ColorFromModel"; }),

I have given the user the option to set the fill color when the node is not highlighted.

So far I have come up with this in my Node Template
new go.Binding("stroke", "isHighlighted", function(h) {
return h ? "dodgerblue" : "How to get the value from the model here?" }

thanks
Vishal

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 7069

Trending Articles