-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4633418
By: marvulix
Hi again,
is it possible to have an horizontal scrollbar for a tree?
i have quite large tree's with an unpredictable width, and the space on the screen is limited. with zk 3.0 RC 1 a horizontal scrollbar appeared when the tree got to wide, in ZK 3.0.0 release the scrollbar dosn't appear.
I attached a small sample showing my problem. There is also a new problem: the tree-items get wrapped. But i solved this issue by adding:
<style>
div.tree-body td {
white-space: nowrap;
}
</style>
As you can see the tree is cut off after the width of the outer div, even though overflow is set to auto...
Any idea how to get the scrollbar? The vertical scrollbar is working fine. as soon as the tree gets high enough the scrollbar appears.
thanks,
marvulix
--------- sample code -----------
<zk>
<div style="position: absolute; width: 80px; border: 1px solid red; overflow:
auto;">
<tree id="tree">
<treecols sizable="true">
<treecol label="Name"/>
</treecols>
<treechildren>
<treeitem>
<treerow>
<treecell label="Item_1"/>
</treerow>
</treeitem>
<treeitem>
<treerow>
<treecell label="Item_2"/>
</treerow>
<treechildren>
<treeitem>
<treerow>
<treecell label="Item_2.1"/>
</treerow>
<treechildren>
<treeitem>
<treerow>
<treecell label="Item_2.1.1"/>
</treerow>
</treeitem>
<treeitem>
<treerow>
<treecell label="Item_2.1.2"/>
</treerow>
</treeitem>
</treechildren>
</treeitem>
<treeitem>
<treerow>
<treecell label="Item 2.2"/>
</treerow> </treeitem> </treechildren>
</treeitem>
<treeitem label="Item 3"/>
</treechildren>
</tree>
</div>
</zk>
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4644632
By: jumperchen
Hi,
You can specify the width of treecol.
For example,
...
<treecol label="Name" width="200px"/>
...
/Jumper
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4651527
By: marvulix
hi,
the 'problem' is my tree items are dynamically created and from the java side i don't know the width needed to visualize the tree.
In the meanwhile i solved it by overwriting another CSS style:
div.cell-inner {
overflow: visible;
}
it's set to overflow: hidden and this causes the rendering issues.
is it intended or a bug?
chio,
marvulix
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4651629
By: jumperchen
Hi,
I think to enabled the overflow is not good idea.
The header element will be specified its width by client engine at initial time.
When you dynamically add a new treeitem into the tree, the new treeitem's width is depended on header. So if the treeitem's width is bigger than header, I think the display will be broken.
/Jumper
I have the same requirement. I found a solution for my case and would like to share. I added treecol with hflex='min' to allow the horizontal bar as needed. I added the style to make treecell not to wrap. Whenever I dynamically add new treecell, I invalidate the tree to make it recalculate the size.
<treecols>
<treecol hflex="min"/>
</treecols>
....
<treecell style="white-space: pre;">
...
Asked: 2007-11-20 10:48:09 +0800
Seen: 786 times
Last updated: Feb 03 '17