Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Programmatically Hide/Show Nodes (Read 2421 times)
Megan1717
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 39
Joined: Jun 20th, 2016
Programmatically Hide/Show Nodes
May 19th, 2020 at 9:22pm
Print Post  
Hello,

I am having trouble figuring out how to hide and show a ShapeNode/DiagramNode on the client side dynamically without redrawing the map. I tried setting the visible property to false, but this doesn't make the node invisible unless I redraw the map. I also tried using jQuery's hide method, but it doesn't seem to be able to locate the node in the DOM.

How can I accomplish show/hide without having to redraw the map?

Thanks.
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3435
Joined: Oct 19th, 2005
Re: Programmatically Hide/Show Nodes
Reply #1 - May 20th, 2020 at 5:01am
Print Post  
Hi,

This works in my test -

Code
Select All
function testVisible()
{
	var diagram = Diagram.find("diagram");
	diagram.getNodes()[0].setVisible(false);
} 



If not working for you, try also calling diagram.invalidate() or node.invalidate() to force redrawing.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Megan1717
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 39
Joined: Jun 20th, 2016
Re: Programmatically Hide/Show Nodes
Reply #2 - May 20th, 2020 at 2:47pm
Print Post  
Hi,

The setVisible() method worked perfectly. I don't have to redraw the map. Thanks very much!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint