0

Horizontal scrollbar for tree?

asked 2007-11-20 10:48:09 +0800

admin gravatar image admin
18691 1 10 128
ZK Team


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>

delete flag offensive retag edit

4 Replies

Sort by ยป oldest newest

answered 2007-11-27 01:36:36 +0800

admin gravatar image admin
18691 1 10 128
ZK Team


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

link publish delete flag offensive edit

answered 2007-11-30 09:48:34 +0800

admin gravatar image admin
18691 1 10 128
ZK Team


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

link publish delete flag offensive edit

answered 2007-11-30 11:14:59 +0800

admin gravatar image admin
18691 1 10 128
ZK Team


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

link publish delete flag offensive edit

answered 2017-02-03 08:06:14 +0800

windeyu gravatar image windeyu flag of United States
288 3

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;">
...
link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2007-11-20 10:48:09 +0800

Seen: 782 times

Last updated: Feb 03