Select multi link

Hi,

How it s possible to select multi links when i select a node?

For exemple when i click on a parent node i would like to select the links with its childs.
I use a treeview and initialise my diagram like that :

   myFullDiagram.model.nodeDataArray = JSON.parse(data.d);
   myFullDiagram.model = new go.TreeModel(myFullDiagram.model.nodeDataArray);

The data structure is key, parent.

Thanks,

Cédric

Such code cannot be triggered when a node is selected, because that would cause all children to be selected due to recursive behavior. But you could trigger such selection behavior based on a click:

myDiagram.addDiagramListener("ObjectSingleClicked", function(e) { var part = e.subject.part; if (part instanceof go.Node) { var it = part.findLinksOutOf(); while (it.next()) { var link = it.value; link.isSelected = true; var child = link.toNode; child.isSelected = true; } } });

Thanks for your reply,

The links don’t change color when the property isSelected = true.

Do you know why?

Sorry my diagram was set with maxSelectionCount: 1.

Thanks a lot!