Quantcast
Channel: GoJS - Northwoods Software
Viewing all articles
Browse latest Browse all 6975

How to collapse all nodes initially but Expand only those which are satisfying a particular condition

$
0
0

@phreq wrote:

I have a GoJS tree in which all the nodes have been added in this way:
var nodeDataArray = [];
item = {}
item["key"] = //someuniquevalue;
item["text"] = //some text with Count;
item["color"] = go.Brush.randomColor();
nodeDataArray.push(item);

Now, is there a way that during adding nodes with the above code, we could expand or collapse all of its children. My condition is that if the Count is more than 30, only then that node should be expanded, otherwise it should be collapsed.

So, in this image, all the nodes having count less than 30 should be collapsed.
Can it be done during adding a node from the above code or after creating the tree and then iterating over all the nodes?
How can I do so?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 6975

Trending Articles