Why i can not create container from nodes

i use bellow code but it is not active correct:

diagramData.nodes[i].children.push(diagramData.nodes[counti].id);


1 Reply

AM Arunkumar Manoharan Syncfusion Team April 13, 2022 06:43 AM UTC

Hi jacmd,


Can you confirm us whether you are creating a group node at runtime? If yes, we suggest you to create a group by using diagram.add method. For more info, please refer to the below code snippet and sample link below.


Code snippet:

let group: NodeModel = {

    id: 'group2',

    children: ['rectangle1', 'rectangle2']

    };

 

diagram.add(group);


Sample Link: https://stackblitz.com/edit/ijhiva-mzqrcr?file=index.ts


And to know more about the group we have attached the UG-Documentation link.

UG Link: https://ej2.syncfusion.com/documentation/diagram/group/


Regards,

Arun Kumar.


Loader.
Up arrow icon