Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Expand icon(+) shown and partial expanded state shown for node having collapsed state (Read 4852 times)
swapnil
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 9
Location: pune
Joined: Sep 14th, 2018
Expand icon(+) shown and partial expanded state shown for node having collapsed state
Sep 27th, 2018 at 11:02am
Print Post  
Hello,

I am using Border tree layout of mind fusion. I am saving the collapsed/expanded state of the nodes and drawing diagram after loading the states. It is working in some cases but when the parent node has more than one children and both the children's have expanded =false and saved then parent node has + icon besides it and one of the child is still shown (refer attachment).Diagram representation is attached.
Any idea why + icon is displayed at node 3 instead of - also why 4th node is still visible when its parent has expanded
=false .
  

tree_diagram.png ( 7 KB | 213 Downloads )
tree_diagram.png
Back to top
 
IP Logged
 
Slavcho
God Member
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: Expand icon(+) shown and partial expanded state shown for node having collapsed state
Reply #1 - Sep 27th, 2018 at 1:01pm
Print Post  
Hi,

Collapsing only hides current child nodes. If you set Expanded = false before creating actual children and connecting them with parent, the newly added children will be visible. Try restoring your states after the tree has been fully built.

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


I Love MindFusion!

Posts: 9
Location: pune
Joined: Sep 14th, 2018
Re: Expand icon(+) shown and partial expanded state shown for node having collapsed state
Reply #2 - Sep 28th, 2018 at 7:27am
Print Post  
Hello,

Tried to set the collapsed state after the diagram is fully created with nodes and links but still the same issue.
Setting the expanded =false in the node from diagrams nodes array.

It should work as instead of clicking the '+,-' icon, I am setting the expanded value on the node itself but getting the same error mentioned previously.
  
Back to top
 
IP Logged
 
Slavcho
God Member
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: Expand icon(+) shown and partial expanded state shown for node having collapsed state
Reply #3 - Sep 28th, 2018 at 8:47am
Print Post  
Hi,

Are you calling the setter method like node.setExpanded(...) or just assigning to the .expanded field?

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


I Love MindFusion!

Posts: 9
Location: pune
Joined: Sep 14th, 2018
Re: Expand icon(+) shown and partial expanded state shown for node having collapsed state
Reply #4 - Sep 28th, 2018 at 9:04am
Print Post  
I am using node.setExpanded(...)
  
Back to top
 
IP Logged
 
swapnil
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 9
Location: pune
Joined: Sep 14th, 2018
Re: Expand icon(+) shown and partial expanded state shown for node having collapsed state
Reply #5 - Sep 28th, 2018 at 12:56pm
Print Post  
Hello,

Below is the sample code with the problem. Please look into it.
Extract the file and run npm install on the folder. Ignore the jasmine errors. Run npm start and open localhost:4200 to run the application in browser.

Regards,
Swapnil Thosar
  

mindfusion.zip ( 258 KB | 268 Downloads )
2018_09_28_18_18_40_Mindfusion.png ( 35 KB | 204 Downloads )
2018_09_28_18_18_40_Mindfusion.png
Back to top
 
IP Logged
 
Slavcho
God Member
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: Expand icon(+) shown and partial expanded state shown for node having collapsed state
Reply #6 - Oct 1st, 2018 at 10:30am
Print Post  
Hi,

Try setting the property in child-to-parent direction starting closest to leaf nodes, e.g. this should work with your test -

Code
Select All
   diagram.getNodes()[3].setExpanded(false);
   diagram.getNodes()[2].setExpanded(false);
   diagram.getNodes()[0].setExpanded(false);
 



That's how users would hide these branches interactively (otherwise they would not see children to collapse) and the control saves some state along the way that gets invalid if starting from the root.

Regards,
Slavcho
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint