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