collection change is not working

Hi, 

When I am dropping the node into the diagrm space, it should fire collection change , it fires but it is not finding instanceof Node not the instanceof Connector. Please help where I am wrong

1 Reply

SG Shyam G Syncfusion Team March 17, 2020 07:04 AM UTC

Hi Rakhi, 

Please set the arguments state as Changed to resolve your issue. Please refer to a code example and the sample below. 

Code example: 

  public collectionChange(args: ICollectionChangeEventArgs) { 
     if(args.state === 'Changed' && args.type === 'Addition') {  
       let changedObj = args.element; 
       if(changedObj instanceof Node) { 
         let nodeId = changedObj.id; 
       } else if(changedObj instanceof Connector) { 
         let connectorId = changedObj.id; 
      
    
 



Regards, 
Shyam G 


Loader.
Up arrow icon