Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted on Nov 04, 2008 05:30
open dhtmlx forum
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?
Answer posted by Support on Nov 04, 2008 07:00
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.
Answer posted on Nov 04, 2008 07:23
We got this to work in firefox by floating the container div left, but IE7 has problems.