Closed mushzak closed 5 months ago
for example when I remove node output_3 from condition_desc, it works, but when trying to remove 2nd it gives issue,
For adding new output I'm using this:
In drawflow outputs and inputs as sequential number.
Example: If you have 3 outputs. And eliminate number 2. Outputs 1 and 2 will remain available.
You are using the functions: removeNodeOutput(id, output_class)
and addNodeOutput(id)
?
I'm adding node output like this
Use
editor.addNodeOutput(idOfNode);
if I use like this, how I can add lables?
is there any function that I can check if output exists or not?
I don't know how you are adding the labels.
But once the connection is added you can always access the node information or add the label to the created connection.
You can get the node information with the function:
const dataNode = editor.getNodeFromId(idOfNode);
Here you can see the outputs and inputs of the nodes.
is there any function that I can check if output exists or not?
There is no function. But you can use what was shown in the comment above to see if the output exists.
tthis will remove "removeNodeOutput(id, output_class)" from child node inputs?
Yes
having issues like this when using "removeNodeOutput(id, output_class)"
My problem is that I can have 3 outputs in the condition node, and then I can remove the second one, or the first one, and in this image, you can see what looks like. I don't have output_2 because I removed it. and after that, I'm having this issue.
In drawflow outputs and inputs are sequential number.
There can be no jump in them.
@jerosoler I'm using .removeNodeOutput() function wrongly?
as I understand the problem is when node has any outputs + connection removeNodeOutput() gives error.
When I try to remove first output which has a connection I see this error
when removing output_2 or output_3 it gives this error
and it works when I remove connection and try remove output again
Please create a codepen to reproduce this problem.
I'm not able to copy json from my working place, I can send screenshots
I found the problem, closing the ticket, thanks.
I have flow like this, and adding outputs dynamically, when trying to remove last output it is working, but for example when I have output_1 output_2 output_3
when deleting output_2 having an issue offsetWidth, and suggestion how I can do this?
also need to remove from child node inputs