Regarding highlighted of multiple Parent Node

Hi
I have more than one Parent node and I want to highlight all the Parent Node. Currently only one Parent Node is selected and rest Parent node is faded or Disabled. You can check my below screenshot.

I have added the below code for highlighted the Parent node. As per this condition
element.key == nodeId i have same element.key and nodeId in all the parent node. But only last Parent is getting highlighted.
image

Can i get any suggestion or example so that all Parent node will get highlighted?

The Diagram.select method makes the argument Part the only selected Part. Diagram | GoJS API

Instead call Diagram.clearSelection first, and then in your iteration set Part.isSelected to true. Part | GoJS API