You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have 4 nodes in drawflow namely
this.nodes = [
{ name: 'node1' },
{ name: 'node2' },
{ name: 'node3' },
];
i am creating connection like this
this.editor.on('connectionCreated', (connection: any)
my connection object is {
"output_id": "1",
"input_id": "2",
"output_class": "output_1",
"input_class": "input_1"
}
My scenarios:
need to allow connection from node1 to node2 only
If I tried to connect to node3 i need to remove that connection
Hi,
I have 4 nodes in drawflow namely
this.nodes = [
{ name: 'node1' },
{ name: 'node2' },
{ name: 'node3' },
];
i am creating connection like this
this.editor.on('connectionCreated', (connection: any)
my connection object is {
"output_id": "1",
"input_id": "2",
"output_class": "output_1",
"input_class": "input_1"
}
My scenarios:
so for removing connection
const sourceNode = this.editor.drawflow.drawflow[this.editor.module].data[sourceNodeId].data.name;
const targetNode = this.editor.drawflow.drawflow[this.editor.module].data[targetNodeId].data.name;
if (sourceNode === 'node1') {
if (['node2'].includes(targetNode)) {
console.log('Allow connection');
} else {
const outputNode = this.editor.getNodeFromId(connection.output_id);
const inputNode = this.editor.getNodeFromId(connection.input_id);
this.editor.removeSingleConnection(outputNode, inputNode,connection.output_class, connection.input_class);
}
}
but connection is not getting removed showing error.
thanks in advance
The text was updated successfully, but these errors were encountered: