calculateWidths() (with the s on the
end). This will start at the top of the tree and open every node, measuring
the widths and then return the width you could use. By default the Tree will
scan up to the first 10,000 nodes. If you want to specify a smaller number
(like you know the first subtree has a max of 100 nodes and nothing below will
be wider) you can specify it as an argument to
calculateWidths(maxNodesToMeasure).
Matt
I have a panel that houses a tree control. I have noticed that the
tree's horizontal scrollbar has a bad habit of
appearing when it
shouldn't, so I had decided to set its
hScrollPolicy to "off", and
thereafter turning it on manually as needed.
In order for this to be possible, I need to know
the width of the tree
after a node has been opened. This is because an
opened node could
effectively make the tree width wider, depending
on how long the text
of the child nodes are.
Checking the documentation, it seems like the
method, calculateWidth
(), is my answer. However, doing
tree.calculateWidth() always returns
NaN, making it useless.
Am I using it wrong? Or is it even known to work?
Any feedback from anyone would be greatly
appreciated, because I need
to make my tree component behave. Thanks.
Yahoo! Groups Links