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

Prevent delete button from removing nodes in treeview

Thread ID:





119070 May 8,2015 02:08 PM UTC May 12,2015 09:25 AM UTC JavaScript 3
Tags: ejTreeView
Robert David
Asked On May 8, 2015 02:08 PM UTC

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 12:38 PM UTC

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 02:35 PM UTC

Thank you.

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

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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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