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

How to disable node select on mouse right click

Thread ID:

Created:

Updated:

Platform:

Replies:

143629 Mar 29,2019 11:23 AM UTC Apr 1,2019 10:37 AM UTC React - EJ 2 1
loading
Tags: Treeview
Sonam Diwate
Asked On March 29, 2019 11:23 AM UTC

I want to disable node click event  for mouse right click.

node click and select node should only work for mouse left click and not on mouse right click.

Regards,
Sonam Diwate

Christopher Issac Sunder K [Syncfusion]
Replied On April 1, 2019 10:37 AM UTC

Hi Sonam Diwate, 

Greetings from Syncfusion!!! 

You can check whether you right click the node by using following code snippet in the nodeSelecting event of treeview and cancel the event if it is right click. 

if (event.which === 3 && event.button === 2) { 
    args.cancel = true; 
} else { 
    alert("Node Selected"); 
} 


Please check the above sample and get back to us if you need any further assistance 

Thanks,
Christo 


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.

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

;