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.

Prevent delete button from removing nodes in treeview

Thread ID:





119070 May 8,2015 10:08 AM May 12,2015 05:25 AM JavaScript 3
Tags: ejTreeView
Robert David
Asked On May 8, 2015 10:08 AM

I'm trying to keep all keyboard functionality other than removing nodes with the delete key. Is there a way of doing this?

Sasikala Nagarajan [Syncfusion]
Replied On May 11, 2015 08:38 AM

Hi Robert,

Thanks for using Syncfusion products,

We have analyzed your requirement (keep all keyboard functionality other than removing nodes with the delete key) and we would like let you know that there is no inbuilt option to achieve this requirement. But we can achieve this by overriding the treeivew’s key press function to cancel the key press event if delete key is pressed.

Please refer the below code snippet

var click = ej.TreeView.prototype._KeyPress;

ej.TreeView.prototype._KeyPress = function (e) {

// {handle the custom event or method here}

if (e.keyCode == 46) return false;

else click.call(this, e);

For your convenience we have prepared the simple sample based on this it can be downloaded from below location.


Please check with the given sample and let us know if you have further queries.


Sasikala Nagarajan

Robert David
Replied On May 11, 2015 10:35 AM

Thank you.

Sasikala Nagarajan [Syncfusion]
Replied On May 12, 2015 05:25 AM

Hi Robert,
Please let us know if you have further queries.We will be happy to help you out.
Sasikala Nagarajan


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.

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.