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

removeArrayItem issues

$
0
0

@llopht wrote:

I have a strange issue...

I listen the modelChange and particulary any removing on the linkDataArray. When this event is raised, I update each port to change the data used for the fill color (the current green circle).

onModelChange(e) {
  if (e.modelChange === 'linkDataArray' && e.change === go.ChangedEvent.Remove) {
    const link = e.oldValue;
    this.updatePorts(link);
  }
}

I delete the link

The findLinksConnected on each portId return no result. It's correct. The port data is correctly updated.

I delete the left node port

Issue 1

I reset the diagram to this previous state (a browser reload or an undo). I delete the left node port (when I click on the right '-' button) with the removeArrayItem method. The modelChange event is called but findLinksConnected return the link normaly deleted.

I delete a port with removeArrayItem but the findLinksConnected find a link normaly deleted. Why ?

Issue 2

Temporary I disabled the process linked to the linkLinksConnected and I set the fill property with the white color (In fact this process search if other links are connected to each ports, if found the color stay in green) :

model.setDataProperty(dataNode, 'fill', statusColor);

The dataNode is strictly the same like I delete the link (my first example), but In this case, the fill binding never receive the new value.

Do you have an idea or do you want I make a codepen ?

Posts: 6

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 6969

Trending Articles