Enable to add outconnect contraint on nodes

Hello,

I have an issue when I try to add a node constraint outConnect. 

In fact we want that node dont be outconnect by any connector.

I add this  but we can set a connector in :

You can find a example in this STACKBLITZ at line 169.

Thx
ej.diagrams.NodeConstraints.Default & ~ej.diagrams.NodeConstraints.OutConnect     

3 Replies

SG Shyam G Syncfusion Team March 11, 2020 05:02 AM UTC

Hi Foulont, 
 
We could not able to load your sample. However, we have created a sample in which we have allowed in-connection to the node and restricted the out-connection. Also, please check whether you are using the latest version (v17.4.55) in your sample. Please refer to a code example and the sample below. 
 
Code example: 
  var diagram = new ej.diagrams.Diagram({ 
  //Sets the default values of a node 
        getNodeDefaults: function (node) { 
            var obj = {};  
            //restrict outconnection on a node 
            obj.constraints = ej.diagrams.NodeConstraints.Default & ~ej.diagrams.NodeConstraints.OutConnect    
            return obj; 
        }, 
}); 
    diagram.appendTo('#diagram'); 
 
 
 
Regards, 
Shyam G 



UN Unknown March 11, 2020 08:25 AM UTC

Hello,

Thanks for your support, in fact the port can be outconnect and I need to set port to disable too. 

Could you please give me an example? 


SG Shyam G Syncfusion Team March 12, 2020 07:03 AM UTC

Hi Foulont, 
 
We have modified a sample in which we have allowed in-connection to the port and restricted the out-connection. Please refer to a code example and the sample below. 
 
Code example: 
//Create and add ports for node. 
function getNodePorts(obj) { 
    var ports = [ 
        { id: 'nport1', shape: 'Circle', offset: { x: 0, y: 0.5 },constraints: ej.diagrams.PortConstraints.Default &~ej.diagrams.PortConstraints.OutConnect  }, 
  
    ]; 
    return ports; 
} 
 
 
 
Regards, 
Shyam G 


Loader.
Up arrow icon