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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

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

Thread ID:

Created:

Updated:

Platform:

Replies:

127567 Nov 23,2016 06:42 PM UTC Nov 24,2016 01:29 PM UTC JavaScript 1
loading
Tags: ejDiagram
Jim Jacobs
Asked On November 23, 2016 06:42 PM UTC

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

Shyam G [Syncfusion]
Replied On 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 


CONFIRMATION

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.

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

;