Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Set focus on a node by code (Read 2534 times)
Santosh
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 28
Joined: Mar 25th, 2015
Set focus on a node by code
Sep 18th, 2015 at 11:29am
Print Post  
How to select or set focus on a node by code?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Set focus on a node by code
Reply #1 - Sep 18th, 2015 at 12:39pm
Print Post  
You could call node.setSelected(true) to select it.

There's no concept of focused node in the diagram API, but you could change node's colors, run a bouncing animation, or call something like diagram.zoomToRect(node.getBounds().inflate(margin)) to bring the node to user's attention.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Santosh
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 28
Joined: Mar 25th, 2015
Re: Set focus on a node by code
Reply #2 - Sep 21st, 2015 at 7:28am
Print Post  
thanks Stoyo...the above code zooms the whole diagram...u mentioned adding animation...like the bounce effect...

what could be the code for the bounce effect? or any other animation? is there any animation function for table node?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Set focus on a node by code
Reply #3 - Sep 21st, 2015 at 8:01am
Print Post  
Check the Animations example (Animations.js in Samples folder) and this help topic:

http://www.mindfusion.eu/onlinehelp/jsdiagram/index.htm?Animations.htm

Animations should work for TableNodes as well.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint