Treechildren

Treechildren contains a collection of treeitem components. It is main body of the Tree and it also the main body of a Treeitem's children.

You can change the page size of each treechildren instance by modifying the pageSize property

<window title="tree demo" border="normal" width="450px">
    <tree id="tree" width="90%" >    
        <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 pageSize="3">                        
                            <treeitem>                            
                                <treerow>                                
                                    <treecell label="Item 2.1.1"/>                                    
                                </treerow>                                
                            </treeitem>                            
                            <treeitem>                            
                                <treerow>                                
                                    <treecell label="Item 2.1.2"/>                                    
                                </treerow>                                
                            </treeitem>                            
                            <treeitem>                            
                                <treerow>                                
                                    <treecell label="Item 2.1.3"/>                                    
                                </treerow>                                
                            </treeitem>                            
                            <treeitem>                            
                                <treerow>                                
                                    <treecell label="Item 2.1.4"/>                                    
                                </treerow>                                
                            </treeitem>                            
                        </treechildren>                        
                    </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>    
</window>

Class Name

org.zkoss.zul.Treechildren

Supported Child Components

Treeitem

Supported Events

Event Name

Event Type

onPaging

org.zkoss.zul.event.PagingEvent

Description:

Notifies one of the pages of a multi-page component is selected by the user.

onPageSize

org.zkoss.zul.event.PageSizeEvent

Description:

Used to notify that the page size is changed (by the user)

Properties

Property

Description

Data Type

Default Value

pageSize

Sets the page size which controls the number of visible child Treeitem. -1 means no limitation.

The default value gets by getTree().getPageSize()

int

10

activePage

Sets the active page (starting from 0).

int

0

Methods

Name

Description

Data Type

Values

getActivePage

Returns the active page (starting from 0).

int

getItemCount

Returns the number of child Treeitem including all descendants.

int

getItems

Returns a readonly list of all descending Treeitem (children's children and so on).

Col lection

getLinkedTreerow

Returns the Treerow that is associated with this treechildren, or null if no such treerow.

Treerow

getPageCount

Returns the number of pages (at least one).

int

getTree

Returns the Tree instance containing this element.

tree

getVisibleBegin

Returns the index of the first visible child.

int

getVisibleEnd

Returns the index of the last visible child.

int

Inherited From