Closed techies-sudo closed 3 years ago
Hello,
Who wants to delete the connection? or the Output?
Have you tried events? https://github.com/jerosoler/Drawflow#events
Jero
So there is a situation that I want to delete an output class, here I deleted class 1 , I used editor,removeNodeOutput(id, output_class), which deletes class, so connection removal event triggered, then I console both editor and getNodeFromId(id). as I shown above, outputs object differs even though it's the same node . output_1 in right side shows empty object which makes sense since there is nothing connected to it. but it I deleted the object, later I figured that connections to output_2 shifted to output_1 and output_3 to output_2 as shown in left side picture. Why is it?
When does the getNodeFromId do? Can you show your code?
Simply because it only has two outputs.
am closing this issue. since I changed the code base I can't share it ,made a work around to make code work.anyway thanks @jerosoler
Say a node has 3 outnodes, if all three nodes are connected to separate nodes![Screenshot from 2021-04-03 16-35-58](https://user-images.githubusercontent.com/61532920/113476741-fc145f00-949a-11eb-98c6-b08493647e34.png)
if I am removing one node say first one(class which is in right side of the node) , 3 will be removed instead 1 by the library. console.log(editor.drawflow.drawflow.Home.data,state.editor.getNodeFromId(id))
though both are same object, outputs object varies , why is this?