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

Node Clone

Thread ID:

Created:

Updated:

Platform:

Replies:

121315 Nov 30,2015 12:14 PM UTC Dec 28,2015 10:07 AM UTC JavaScript 3
loading
Tags: ejDiagram
hamidR
Asked On November 30, 2015 12:14 PM UTC

Hello.
Can I Deny to copy root element (for example by constrains)
thanks.

Shyam G [Syncfusion]
Replied On December 1, 2015 05:47 PM UTC

Hi Hamid,

Please use command manager to prevent the copy command. please refer to the code example and JSPlayground link below. If we misunderstood your requirement, please provide us more details such as the usecase in which you need to prevent the copy command or more details about your requirement.

Code example:

$("#diagram").ejDiagram({         

            commandManager: {

                commands: {

                    //Command name

                    "copy": {

                        //Command handler

                        canExecute: function copy(args) { return false },

                    }

                }

            },
        });

jsPlayground link:http://jsplayground.syncfusion.com/sarli221

Regards,
Shyam G


hamidR
Replied On December 27, 2015 11:02 AM UTC

Hello.
Thanks for your reply, but my problem not dissolve.
assume mind map diagram that has a ROOT node. i can disable only copy of root node.
thanks

Shyam G [Syncfusion]
Replied On December 28, 2015 10:07 AM UTC

Hi Hamid,

We have created a mind map sample in which we have disabled the copy of root node using the command manager. Please refer to the code example and JSPlayground link.

Code example:

$("#diagram").ejDiagram({

 

                commandManager: {

                    commands: {

                        //Command name

                        "copy": {

                            //Command handler

                            canExecute: copying,

                        }

                    }

                },

 
            });

  function copying(args) {            

            var node = args.model.selectedItems.children[0];

            if (node.branch == "root") {

                return false;

            }

            else

            {

                return true;

            }
        }

JSPlayground link:http://jsplayground.syncfusion.com/n0pk35ee

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

;