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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

The 'collectionChange' event is not triggered when nodes are ungrouped.

Thread ID:





149685 Dec 5,2019 11:53 AM UTC Dec 9,2019 04:21 AM UTC Angular - EJ 2 3
Tags: Diagram
Asked On December 5, 2019 11:53 AM UTC

Hello Syncfusion Team,

Our app uses Syncfusion's DiagramComponent ("@syncfusion/ej2-angular-diagrams": "^17.3.26").

In our app, we'd like to save the user's diagram whenever the user groups or ungroups nodes.

We received the collectionChange event when nodes are grouped together.

However no events are seemingly triggered when the grouped nodes are ungrouped. 

I have a stackblitz demo here (please see the console log there): https://stackblitz.com/edit/diagram-ungroup-no-event

Is this a bug or am I doing something wrong?


Shyam G [Syncfusion]
Replied On December 6, 2019 06:09 AM UTC

Hi Mithun, 

Please use historyChange event to track the group/ungroup action. Please refer to a code example and modified sample below. 

Code example: 
//inject undo redo module  

<ejs-diagram #diagramControl id="diagram-control" 
      width="100%" height="500px" 

onHistoryChange(args: IHistoryChangeArgs) {  
    if((args.change as any).type === 'Group' || (args.change as any).type === 'UnGroup') { 

Shyam G 

Replied On December 6, 2019 08:50 AM UTC

Thanks Shyam. That worked! 

A small concern though... 

(args.change as any).type === 'Group'

The '.type' property does not seem to be a publicly documented property of  'SelectorModel' (which is the type of args.change).

Just want to future-proof my solution so there are no inadvertent breaking changes in future. 


Shyam G [Syncfusion]
Replied On December 9, 2019 04:21 AM UTC

Hi Mithun, 

Sorry for the inconvenience. 

To achieve your requirement, we use interface to implement the type. Please refer to a code example and sample below. 

Code example: 
interface IHistory { 
  type: string 

onHistoryChange(args: IHistoryChangeArgs) {   
    if((args.change as IHistory).type === 'Group' || (args.change as IHistory).type === 'UnGroup') { 

Shyam G 


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