@hamid wrote:
Hi all.
I need to change the color of two ports which are endpoints of a link connected between two different nodes in Dynamic Ports Sample. My mean is that two endpoints ports color get changed as soon a link connected between them.
I applied a custom color on model.setDataProperty of portcolor in computeEndSegmentLength
event function as follow. But the problem is that after connecting two ports by a link, i need to select the nodes and change their position to changing portcolor get effect.
CustomLink.prototype.computeEndSegmentLength = function(node,port,spot,from)
{
var other = this.getOtherPort(port);
.
.
.
myDiagram.model.startTransaction("colorPort");
var color = "rgb(0,255,0)"; // get Green
myDiagram.model.setDataProperty(other.data,"portColor",go.Brush.darken(color));
myDiagram.model.commitTransaction("colorPort");
.
.
.
}I appreciate any hint.
Thank you.
Posts: 1
Participants: 1