-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi,
I have a tree component in the center region of a border layout. I set the autoscroll property to true in the center region. When I scroll the tree, the column labels scroll away too. Is there a way I can modify the code such that the tree column names are always visible?
I have two tree columns with labels "Name" and "Type" in the tree. When I scroll the tree in the center region the tree column labels disappear. I would like to see "Name" and "Type" when I scroll the tree too.
You may test this at: http://top.cs.vt.edu:8080/editionbuilder/src/zul/libappbuildertest.zul
See code below:
<zk xmlns:w="http://www.zkoss.org/2005/zk/client" xmlns:js="http://www.zkoss.org/2005/zk/client"> <borderlayout width="98%"> <north size="110px"> <vbox hflex="1"> Header Area </vbox> </north> <west size="33%"> <borderlayout vflex="true" hflex="1"> <north title="North" size="20%" autoscroll="true"> <vbox hflex="1"> This is North </vbox> </north> <center title="Center" autoscroll="true"> <tree id="packageTree"> <treecols> <treecol label="Name" /> <treecol label="Type" width="62px" /> </treecols> <treechildren> <treeitem> <treerow> <treecell label="Item 1" /> <treecell label="Description" /> </treerow> </treeitem> <treeitem> <treerow> <treecell label="Item 2" /> <treecell label="Description" /> </treerow> </treeitem> <treeitem> <treerow> <treecell label="Item 3" /> <treecell label="Description" /> </treerow> </treeitem> <treeitem> <treerow> <treecell label="Item 4" /> <treecell label="Description" /> </treerow> </treeitem> <treeitem> <treerow> <treecell label="Item 5" /> <treecell label="Description" /> </treerow> </treeitem> <treeitem> <treerow> <treecell label="Item 6" /> <treecell label="Description" /> </treerow> </treeitem> <treeitem> <treerow> <treecell label="Item 7" /> <treecell label="Description" /> </treerow> </treeitem> <treeitem> <treerow> <treecell label="Item 8" /> <treecell label="Description" /> </treerow> </treeitem> <treeitem> <treerow> <treecell label="Item 9" /> <treecell label="Description" /> </treerow> </treeitem> <treeitem> <treerow> <treecell label="Item 10" /> <treecell label="Description" /> </treerow> </treeitem> <treeitem> <treerow> <treecell label="Item 11" /> <treecell label="Description" /> </treerow> </treeitem> <treeitem> <treerow> <treecell label="Item 12" /> <treecell label="Description" /> </treerow> </treeitem> <treeitem> <treerow> <treecell label="Item 13" /> <treecell label="Description" /> </treerow> </treeitem> <treeitem> <treerow> <treecell label="Item 14" /> <treecell label="Description" /> </treerow> </treeitem> <treeitem> <treerow> <treecell label="Item 15" /> <treecell label="Description" /> </treerow> </treeitem> <treeitem> <treerow> <treecell label="Item 16" /> <treecell label="Description" /> </treerow> </treeitem> <treeitem> <treerow> <treecell label="Item 17" /> <treecell label="Description" /> </treerow> </treeitem> <treeitem> <treerow> <treecell label="Item 18" /> <treecell label="Description" /> </treerow> </treeitem> <treeitem> <treerow> <treecell label="Item 19" /> <treecell label="Description" /> </treerow> </treeitem> <treeitem> <treerow> <treecell label="Item 20" /> <treecell label="Description" /> </treerow> </treeitem> <treeitem> <treerow> <treecell label="Item 21" /> <treecell label="Description" /> </treerow> </treeitem> <treeitem> <treerow> <treecell label="Item 22" /> <treecell label="Description" /> </treerow> </treeitem> <treeitem> <treerow> <treecell label="Item 23" /> <treecell label="Description" /> </treerow> </treeitem> <treeitem> <treerow> <treecell label="Item 24" /> <treecell label="Description" /> </treerow> </treeitem> <treeitem> <treerow> <treecell label="Item 25" /> <treecell label="Description" /> </treerow> </treeitem> </treechildren> </tree> </center> <south title="South" size="40%" autoscroll="true"> <tree id="workspaceTree"> <treecols> <treecol label="Name" /> <treecol label="Type" width="62px" /> </treecols> </tree> </south> </borderlayout> </west> <center title="Edit Area" flex="true" /> </borderlayout> </zk>
Thanks,
Sony
Hi Sony,
you may want to check the Frozen component in case you're using ZK 5.0: Frozen component
Also, take a look at this forum thread: http://www.zkoss.org/forum/listComment/6855
Let us know if it worked for your Tree component.
Thank you,
Gyo
Hi Gyowanny,
Thanks for your reply. Yes, I am using ZK 5.0. The ZK Frozen component works for Grids and Listboxes. It did not work for my Tree.
In my above code, I added the a frozen child like so:
<tree id="packageTree"> <frozen columns="2" /> <treecols> ................ </tree>
But the Tree component does not support frozen component as its child. I see the error:
org.zkoss.zk.ui.UiException: Unsupported newChild: <Frozen null>
I also tried
<frozen treecols="2" />
It does not work for the same reason that frozen component is not supported by tree. Do you suggest I add this as a feature request?
Thanks,
Sony
Asked: 2011-10-18 17:18:03 +0800
Seen: 352 times
Last updated: Aug 31 '12