tree auto width with vertical scroll

We need a tree which automatically adjusts the width when nodes are open/closed (to prevent horizontal scrolling). However, we want to set vertical scrolling.

We can get vertical scrolling working but the scroll bar is either all the way to the right of the screen since width is 100% or if we set width to say 300px then this causes horizontal scrolling when nodes are opened.

Any solution?

Unfortunately tree can’t work in such “auto-width” mode.
You can attach code to onOpen event and check tree’s inner width as tree.allTree.scrollWidth and adjust width of tree’s container accordingly.

We got this to work in firefox by floating the container div left, but IE7 has problems.