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

Collapse all nodes when doubleclick

$
0
0

@HachimDev wrote:

Hi,
Sorry if this is an obvious question but im still learning GoJS (which is great btw)
so my question is how can i collapse all nodes when doubleclicking on one of them ?
I want to be have only one expanded node at all time

here is my code :

go.Node, {
    selectionAdorned: false,
    isTreeExpanded: false,

    doubleClick: (e, node) => {

        let cmd = myTreeLocal.commandHandler;
        if (!node.isTreeLeaf) {
            if (!node.isTreeExpanded) {
                if (!cmd.canExpandTree(node)) return;
                cmd.expandTree(node);
                NetworkActions.requestNetworkbyId(node.Zd.dataKey);
            }
        } else {
        }
    }
},

Thank you !

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 7069

Trending Articles