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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to detect if editing text

Thread ID:

Created:

Updated:

Platform:

Replies:

119204 May 21,2015 07:47 PM UTC May 22,2015 11:39 AM UTC ASP.NET Web Forms 1
loading
Tags: Diagram
Jim Jacobs
Asked On May 21, 2015 07:47 PM UTC

Hi,

It seems that selecting one or more objects and then clicking on the Delete key, results in the browser navigating to the previous page.

I realize that I can detect the Delete key being pressed, but I also need to know that I am not editing text on a node or connector.  If that is the case, then the Delete key should be allowed to do what it normally would do - delete characters.  But if no text is being edited, I can then perform a diagram.remove(); rather than let the browser navigate.

Suggestions?

Thanks

Jim




Shyam G [Syncfusion]
Replied On May 22, 2015 11:39 AM UTC

Hi Jim

Thanks for using Syncfusion products.

Please note that by default when we edit the node’s label and press the delete key, the node will not be deleted. However we suggest you to use label’s “mode” property to identify whether the label is in edit mode or view mode. Please refer the online UG documentation link for more details. Please refer the code snippet below.

UGDocumentationLink:http://help.syncfusion.com/ug/js/Documents/label.htm


Code snippet:

$(window).keydown(function (e) {

var diagram = $("#DiagramContent").ejDiagram("instance");

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

if (node && node.labels[0]) {

//identify whether label is in edit mode

if (ej.datavisualization.Diagram.LabelEditMode.Edit == "edit") {

alert();

}

//identify whether label is in view mode

if (ej.datavisualization.Diagram.LabelEditMode.View == "view") {

alert();

}

}
});

Please let me know if any concerns.

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

;