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

How to detect that a paste of multiple objects has completed?

Hi,

I have a requirement to know when a diagram.paste operation is complete.
For example, the user may perform a Select All + Copy, then move to a new diagram and perform a Paste.
This may include a few objects or hundreds of objects.
Since I display a busy screen when the paste starts, I need a way of determining that the paste of all objects is complete - so that I can hide the busy screen.

Any thoughts (code snippets)?

Thanks in advance

Jim

1 Reply

SG Shyam G Syncfusion Team November 24, 2016 01:29 PM UTC

Hi Jim, 

Please use command manager to achieve your requirement. Please refer to the code example and sample below. 

Code example: 

Command paste = new Command() 
                { 
                    Execute = "executepaste", 
                    CanExecute = "canexecutepaste", 
                    Gesture = new Gesture() { Key = Keys.V, KeyModifiers = KeyModifiers.Control } 
                }; 
                DiagramContent.CommandManager.Commands.Add("paste", paste);     
 
function executepaste(args) { 
     var diagram = $("#DiagramContent").ejDiagram("instance"); 
     diagram.paste(); 
     //you can hide the busy screen 
 } 
 
 function canexecutepaste(args) { 
     if (args.model.selectedItems.children.length) { 
         return true; 
     } 
 } 


Regards, 
Shyam G 


Loader.
Up arrow icon