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

Is it possible to programmatically move focus to another node in overview component?

Thread ID:

Created:

Updated:

Platform:

Replies:

149229 Nov 19,2019 02:23 PM UTC Nov 20,2019 08:35 AM UTC React - EJ 2 3
loading
Tags: Diagram
Dominique Toussaint
Asked On November 19, 2019 02:23 PM UTC

Is it possible to programmatically by some function move the focus to a certain node using overview component zoom options?

Best regards
Jiway S.A.

Shyam G [Syncfusion]
Replied On November 20, 2019 07:09 AM UTC

Hi Jiway, 

Please use the bringToCenter diagram method to focus and bring the node to the center of the viewport. We have created a sample where you can select a node and click on the button bringToCenter to take the node to the viewport center. Please refer to a code example and sample below. 
 
Code example: 
  bringToCenter() {  
        var node = diagramInstance.selectedItems.nodes[0]; 
        if (node) { 
            //bring the selected node to center 
            diagramInstance.bringToCenter({ x: node.offsetX, y: node.offsetY, width:node.width, height: node.height}); 
        } 
}  
 
 
 

Regards, 
Shyam G 


Dominique Toussaint
Replied On November 20, 2019 08:07 AM UTC

Hi Shyam G,

thanks, it works, such a great functionality.

Best regards,
Jiway S.A.

Shyam G [Syncfusion]
Replied On November 20, 2019 08:35 AM UTC

Hi Jiway, 
Thanks for your update. 
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