-
FEATURED COMPONENTS
First time here? Check out the FAQ!
How can I make the following tree stretch, so that if a user pulled the bottom border of the tree down, the tree expands to display more rows of data? By default, the tree should show only 8 rows of data. Can this be done in ZK?
-----------------------------------------------------------------------------------------------------------
<hbox width="100%">
<vbox>
Four style of trees :
<radiogroup
onCheck='tree.setZclass("z-"+self.selectedItem.value)'>
<vbox>
<radio label="Default" value="tree" selected="true"/>
<radio label="Dot Tree" value="dottree" />
<radio label="XP Explorer" value="filetree" />
<radio label="Vista Explorer" value="vfiletree" />
</vbox>
</radiogroup>
</vbox>
<tree id="tree" width="400px" rows="8">
<treecols sizable="true">
<treecol label="Name" />
<treecol label="Description" />
</treecols>
<treechildren>
<treeitem>
<treerow>
<treecell label="Item 1" />
<treecell label="Item 1 description" />
</treerow>
</treeitem>
<treeitem>
<treerow>
<treecell label="Item 2" />
<treecell label="Item 2 description" />
</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" />
<treecell
label="Item 2.2 is something who cares" />
</treerow>
</treeitem>
<treeitem>
<treerow>
<treecell label="Item 2.2" />
<treecell
label="Item 2.2 is something who cares" />
</treerow>
</treeitem>
<treeitem>
<treerow>
<treecell label="Item 2.2" />
<treecell
label="Item 2.2 is something who cares" />
</treerow>
</treeitem>
</treechildren>
</treeitem>
<treeitem label="Item 3" />
</treechildren>
</tree>
</hbox>
Hi sparqle,
Change the
<tree id="tree" width="400px" rows="8">
<tree id="tree" width="400px" rows="10">
My question really was if I had say a tree with 30 items, and I do not always want to show all 30 items as it may take too much space for most users' preferences. However, if it was possible to stretch the tree dynamically to display more rows, it would be nice. So by default I want to display only 8 rows. But I want to display more rows if the user tries to stretch the tree by pulling the bottom of the tree. Wondering whether the vflex property is meant for this purpose?
Hi sparqle,
Do you want the effect like this?
http://www.zkoss.org/zkdemo/userguide/#g12
Asked: 2009-02-25 21:23:29 +0800
Seen: 169 times
Last updated: Feb 27 '09