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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Paste feature

Thread ID:

Created:

Updated:

Platform:

Replies:

120701 Oct 6,2015 07:56 AM UTC Oct 7,2015 09:12 AM UTC JavaScript 1
loading
Tags: ejDiagram
hamidR
Asked On October 6, 2015 07:56 AM UTC

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.

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


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

;