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

Paste feature

hello
how can i disable paste function in diagram, because of i am create special function for ctl+v key code.
Thank for your very good component.

1 Reply

SG Shyam G Syncfusion Team October 7, 2015 09:12 AM UTC

Hi Hamid,

To achieve your requirement, please use “Command Manager” which provides support to map/bind command execution with desired combination of key gestures. Please refer to the  drafted version of documentation and code example below.

Drafted documentation:http://www.syncfusion.com/downloads/support/forum/120701/ze/Command_Manager-JS-1519773830

Code example:

$("#diagram").ejDiagram({

            commandManager: {

                commands: {

                    //command to remove the selected Item

                    "remove": {

                        //Method to define whether the command can be executed at the current moment

                        canExecute: function (args) {

                            //Defines that the remove command can be executed, if and only if the selection list is not empty.

                            if (args.model.selectedItems.children.length) return true;

                        },

                        //Command handler

                        execute: function (args) {

                                //Logic to remove the selected item

                            $("#diagram").ejDiagram("instance").remove();

                        },

                        //Defines that the remove command has to be executed on the recognition of Ctrl+V key press.

                        gesture: { key: ej.datavisualization.Diagram.Keys.V, keyModifiers: ej.datavisualization.Diagram.KeyModifiers.Ctrl }

                    }

                }

            }
        });

Regards,
Shyam G


Loader.
Live Chat Icon For mobile
Up arrow icon