12/18/2006

FLEX2: let the horizontal scroll bar works in Tree control

we know that the horizontal scroll bar is not work properly in tree control of FLEX2, especially the auto option.
what all I want is let horizontal scroll bar appear and work while the width of tree control is not enough to display the visble tree node.
but unfortunately adobe seems make this feataure disabled. so we need make it works ourself.
first thing, of course google it, and I found out a possible solution from everflash
the author try to change the value of maxHorizontalScrollPosition by doing the measurement on all visible items in the tree, yes it works and seems good.
But after I downloaded the source and go through it, I feel sad because the solution need our tree node data extends a custumized class named "TreeNode". in fact it won't be a total solution of this issue. actually what I want is an extensible tree. so I try to imporve the tree control from everflash.
after two days hard work, I make the control much more simple what with out any extends required. so you just need use my tree named "HScrollTree" instead of mx:tree. That's all.

No comments: