Error while ungrouping symbols: TypeError: labels[j] is undefined

Hello syncfusion team,

I'm using the latest version 19.4.38 of the DiagramComponent in my app.

As can be seen from the attached gif file, I'm encountering the below error while trying to ungroup symbols.

TypeError: labels[j] is undefined
    removelabelExtension ej2-diagrams.es2015.js:44238
    removeLabels ej2-diagrams.es2015.js:44308
    unGroup ej2-diagrams.es2015.js:33876
    unGroup ej2-diagrams.es2015.js:41334
    contextMenuItemClick ej2-diagrams.es2015.js:51482
    notify ej2-base.es2015.js:2325
    trigger ej2-base.es2015.js:5162
    clickHandler ej2-navigations.es2015.js:2290
    Angular 14
    add ej2-base.es2015.js:4452
    wireEvents ej2-inputs.es2015.js:8167
    render ej2-inputs.es2015.js:7855
    appendTo ej2-base.es2015.js:6703
    Angular 38
    RxJS 6
    Angular 39


Below are the node defaults used in the app.

Please let me know if any additional details are required to help investigate this issue.

Thanks,

-Mithun



Attachment: ungroupingerror_5f53aa33.zip

3 Replies 1 reply marked as answer

SS Sivakumar Sekar Syncfusion Team December 29, 2021 02:36 PM UTC

Hi Mithun, 

We have added a sample to perform group and ungroup in the diagram. In the getNodeDefaults method check if the node has children or not. If the node does not have children means then getNodeDefaults want to apply for the node. Please refer to the below code snippet and sample 

if(!node.children
   
      node.annotations = [ 
       
          id: 'label1', 
          content: 'Annotation', 
        }, 
      ]; 
   


Regards, 
Sivakumar 



Marked as answer

MI Mithun December 30, 2021 04:16 PM UTC

Thanks Sivakumar, that seemed to work! Highly appreciate the help.


Thanks,

-Mithun




SS Sivakumar Sekar Syncfusion Team December 31, 2021 12:38 PM UTC

Hi Mithun, 
 
Thanks for your update 
 
Regards,  
Sivakumar  



Loader.
Up arrow icon