How to enable a vertical scrollbar inside a group with tree layout


#1

I have a group which is a tree structure. Since I am fetching records from server during load, it displays a long tree without scrollbar. My requirement is that I want to restrict the height of my panel (containing all my tree nodes) and provide scroll bar if in case it exceeds the height.

I tried allowVerticalScroll: true, but this property is applicable only for diagram and i just want the scrollbar only for that panel.

Also, when I try to create a link between two nodes between two such trees, and since it’s the destination node is currently not visible, i want an auto scroll kind of functionality for that panel. Like if I drag the link, the scroll bar goes up and the nodes at the bottom become visible so that link can now be formed.

Hope I am clear in explaining my requirement.


#2

I assume you are starting from the sample http://gojs.net/latest/samples/treeMapper.html.

What you describe is not possible in GoJS at this time because Groups cannot clip their member subgraphs.

It might be possible to simulate some of this by individually controlling the visibility of member nodes assuming the nodes are ordered linearly and that is OK to show or hide whole nodes rather than clipping fractional nodes.


#3

Just for a while forget about the tree structure. Suppose I have a panel with 100 nodes inserted linearly, But since my height of the panel is set to a definite value, I want a scroll bar to appear for that panel so that the bottom nodes can be visible by scrolling down.


#4

As I said, Groups do not clip their member Nodes. But it might be possible for you to explicitly manage the visibility of the Nodes.

Regarding scrollbars, consider: http://gojs.net/latest/extensions/ScrollingTable.html.


#5

Hi walter,
For current version. Is it posible to apply scrollbar to group?


#6

The capabilities of Groups has not changed.


#7

Here’s a ScrollingGroupLayout: http://gojs.net/temp/ScrollingGroup.html


#8

thank you, Walter.


#9

Hi,
can’t open ScrollingGroupLayout: http://gojs.net/temp/ScrollingGroup.html


#10

Sorry about that – try again.