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

how to style drag/drop

Thread ID:

Created:

Updated:

Platform:

Replies:

146342 Jul 31,2019 09:47 PM UTC Aug 2,2019 07:12 AM UTC ASP.NET MVC - EJ 2 3
loading
Tags: Diagram
Chad Carey
Asked On July 31, 2019 09:47 PM UTC

I have a node template going and it lost the red borders when I drag a node over another node. In JS, how can I add those styles into my node template?

Shyam G [Syncfusion]
Replied On August 1, 2019 09:33 AM UTC

Hi Chad, 
 
Please set NodeConstraints as AllowDrop in setNodeTemplate function which shows the red highlighter, when we drag the node and mouse hover on the another node. please refer to a below code example. 
 
Code example: 
 
@Html.EJS().Diagram("diagram").Width("100%").Height("500px"). SetNodeTemplate("setNodeTemplate").Render() 
 
function setNodeTemplate(obj, diagram) {  
               //AllowDrop Constraints 
                obj.constraints = ej.diagrams.NodeConstraints.Default | ej.diagrams.NodeConstraints.AllowDrop; 
} 
 
Regards, 
Shyam G  


Chad Carey
Replied On August 1, 2019 12:54 PM UTC

correct, the drag/drop functionality works fine but the highlighting no longer functions.

plus I would like to know how you can style the highlighting differently.

Shyam G [Syncfusion]
Replied On August 2, 2019 07:12 AM UTC

Hi Chad, 
 
By default, when we drag a node and hover on another node, red border appears and to change the border color, please use the below CSS in your application. Also, we have demonstrated an video to show the border color which appears on hovering the node over a another node. If we misunderstand your requirement, could you please share us more details such as explain your requirement with video or screenshot. 
 
Code example: 
// changed border color to blue 
<style> 
    .e-diagram-highlighter { 
        stroke: #0078d6; 
        stroke-width: 2; 
    } 
</style> 
 
 
 
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