Border color the same color with link

hi, forum Gojs

the link default is blue but when link errror , this link is red , now i want this groups have border is red like this picture
, please support me

How do you turn the link red? Do you have data Bindings in the link template, with the source property some property on the link data?

    $(go.Shape, . . .,
        new go.Binding("stroke", "redflag", function(red) { return red ? "red" : "blue"; }))

That would be the normal way to change the appearance of anything. So you could add a Binding on the group’s border Shape’s stroke property, depending on some property on the group data object. You might as well use the same property name that you are using on the link data object.

Does that red link connect with the group node or with a simple node that is a member of the group? In the former case you can find the group data object in the model corresponding to the link data object’s “to” property node key.

var groupdata = model.findNodeDataForKey(model.getToKeyForLinkData(linkdata));
if (groupdata) model.set(groupdata, "redflag", true);

But in the latter case you will need to do that and then get the “group” property of that node data object and find that group data object in the model.

var nodedata = model.findNodeDataForKey(model.getToKeyForLinkData(linkdata));
if (nodedata) {
    var groupdata = model.getGroupKeyForNodeData(nodedata);
    if (groupdata) model.set(groupdata, "redflag", true);

A post was split to a new topic: How to avoid overlap of group label with member nodes?