The MindFusion Forums
Gauge and Chart Components >> Html Canvas & JavaScript >> Expand icon(+) shown and partial expanded state shown for node having collapsed state
https://mindfusion.eu/Forum/YaBB.pl?num=1538046179

Message started by swapnil on Sep 27th, 2018 at 11:02am

Title: Expand icon(+) shown and partial expanded state shown for node having collapsed state
Post by swapnil on Sep 27th, 2018 at 11:02am
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 | 219 Downloads )

Title: Re: Expand icon(+) shown and partial expanded state shown for node having collapsed state
Post by Slavcho on Sep 27th, 2018 at 1:01pm
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

Title: Re: Expand icon(+) shown and partial expanded state shown for node having collapsed state
Post by swapnil on Sep 28th, 2018 at 7:27am
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.

Title: Re: Expand icon(+) shown and partial expanded state shown for node having collapsed state
Post by Slavcho on Sep 28th, 2018 at 8:47am
Hi,

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

Regards,
Slavcho

Title: Re: Expand icon(+) shown and partial expanded state shown for node having collapsed state
Post by swapnil on Sep 28th, 2018 at 9:04am
I am using node.setExpanded(...)

Title: Re: Expand icon(+) shown and partial expanded state shown for node having collapsed state
Post by swapnil on Sep 28th, 2018 at 12:56pm
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
https://mindfusion.eu/Forum/YaBB.pl?action=downloadfile;file=mindfusion.zip ( 258 KB | 275 Downloads )
2018_09_28_18_18_40_Mindfusion.png ( 35 KB | 213 Downloads )

Title: Re: Expand icon(+) shown and partial expanded state shown for node having collapsed state
Post by Slavcho on Oct 1st, 2018 at 10:30am
Hi,

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


Code (]
   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

The MindFusion Forums » Powered by YaBB 2.6.11!
YaBB Forum Software © 2000-2024. All Rights Reserved.