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: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

On hover of nodes can we have icons above node which supports few other functionalities like edit and delete.

Thread ID:

Created:

Updated:

Platform:

Replies:

148816 Nov 5,2019 03:23 PM UTC Nov 22,2019 11:50 AM UTC React - EJ 2 3
loading
Tags: Diagram
Sudhanshu Jain
Asked On November 5, 2019 03:23 PM UTC

Hi,

On hover of nodes can we have icons above node which supports few other functionalities like edit and delete?

Regards,
Sudhanshu

Shyam G [Syncfusion]
Replied On November 6, 2019 12:52 PM UTC

Hi Sudhanshu, 
 
When we mouse hover on nodes, the diagram mouseOver event gets triggered. In this event, you can create an icon with your own custom logic. 
 
Code example: 
  <DiagramComponent 
         id="diagram"     
       mouseOver={(args: IMouseEventArgs) => { 
        // do your own logic 
    }}/> 
 
 
 
Regards, 
Shyam G 


Sudhanshu Jain
Replied On November 21, 2019 01:11 PM UTC

Hi Shyam,

I have used userhandle for this issue but is there a way to set visibility of this userhandle to false on drag of the shapes from symbol palette. 
I require the userhandle to be visible only on selection of shapes in canvas. In rest of the time like drag drop of shapes from symbol palette the userhandle should not be visible.

Please let me know on same.
Thanks

Shyam G [Syncfusion]
Replied On November 22, 2019 11:50 AM UTC

Hi Sudhanshu, 
 
We have created a sample in which we have shown user handle in selectionChange event and hidden it in the positionChange and collectionChange event. So, the user handle will be visible only when you select a node in the diagram. 
 
Code example: 
<DiagramComponent 
collectionChange={(args) => { 
                showHideUserhandles(false); 
              }} 
              selectionChange={(args) => { 
                showHideUserhandles(true); 
              }} 
              positionChange={(args) => { 
                showHideUserhandles(false); 
              }}/> 
 
function showHideUserhandles(visiblity) { 
  // Iterate an handles 
  for (let i = 0; i < diagramInstance.selectedItems.userHandles.length; i++) { 
    let userHandle = diagramInstance.selectedItems.userHandles[i]; 
    //show/hide the userhandle 
    userHandle.visible = visiblity; 
  } 
}  
 

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.

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

Live Chat Icon For mobile
Live Chat Icon