We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Can the ids of the nodes and connectors be changes

Thread ID:

Created:

Updated:

Platform:

Replies:

149257 Nov 20,2019 09:13 AM UTC Nov 21,2019 04:10 AM UTC React - EJ 2 1
loading
Tags: Diagram
Sudhanshu Jain
Asked On November 20, 2019 09:13 AM UTC

Hi,

Can we change the ids of nodes and connectors added to the canvas?

Regards,
Sudhanshu

Shyam G [Syncfusion]
Replied On November 21, 2019 04:10 AM UTC

Hi Sudhanshu, 
 
The  Node and connector id should be unique and could not be changed at runtime. However, you can use node’s addInfo property to add custom information in node. We have created a sample in which we define node’s addInfo property initially and shown how to get an addInfo property at runtime. This approach will help you to achieve your requirement.  
 
Code example: 
let nodes = [ 
    { 
        id: "NewIdea", 
        // define custom information 
        addInfo: {id: 'NewIdea'}, 
    },] 
 
//get custom information at runtime 
function getNode() { 
   //get nodes 
    let nodes= diagramInstance.nodes; 
    // iterate nodes 
    for(var i=0;i<nodes.length;i++){ 
      let node = nodes[i]; 
      //get a addinfo value; 
      let nodeId = node.addInfo.id; 
     if(nodeId = "yourid") { 
          // do your code 
      } 
    } 
} 
 
 
 
Regards, 
Shyam G 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon