Listheader

The list header which defines the attributes and header of a columen of a list box. Its parent must be Listhead.

<window title="listbox demo" border="normal">
        <listbox id="box" width="250px">        
            <listhead sizable="true">            
                <listheader label="name" sort="auto"/>                
                <listheader label="gender" sort="auto"/>                
            </listhead>            
            <listitem>            
                <listcell label="Mary"/>                
                <listcell label="FEMALE"/>                
            </listitem>            
            <listitem>            
                <listcell label="John"/>                
                <listcell label="MALE"/>                
            </listitem>            
            <listitem>            
                <listcell label="Jane"/>                
                <listcell label="FEMALE"/>                
            </listitem>            
            <listitem>            
                <listcell label="Henry"/>                
                <listcell label="MALE"/>                
            </listitem>            
            <listfoot >            
                <listfooter><label value="This is footer1"/></listfooter>                
                <listfooter><label value="This is footer2"/></listfooter>                
            </listfoot>            
                </listbox>                
</window>

Class Name

org.zkoss.zul.Listheader

Supported Child Components

*NONE

Supported Events

Name

Event Type

onClick

org.zkoss.zk.ui.event.MouseEvent

Description: Denotes user has clicked the component.

onRightClick

org.zkoss.zk.ui.event.MouseEvent

Description: Denotes user has right-clicked the component.

onDoubleClick

org.zkoss.zk.ui.event.MouseEvent

Description: Denotes user has double-clicked the component.

Properties

Property

Description

Data Type

sortAscending

Sets the ascending sorter, or null for no sorter for the ascending order.

java.util.Comparator

sortDescending

Sets the descending sorter, or null for no sorter for the descending order.

java.util.Comparator

sortDirection

Sets the sort direction.

Value: ascending|descending|natural

java.lang.String

maxlength

the maximal length of each item's label.

Positive integer

Methods

Name

Description

Return Data Type

getListbox()

Returns the listbox that contains this column.

org.zkoss.zul.Listbox

getOuterAttrs()

java.lang.String

getSclass()

Returns the style class.

java.lang.String

onSort()

It invokes sort(boolean) to sort list items and maintain getSortDirection().

void

getColumnIndex()

Returns the column index, starting from 0.

int

setParent(org.zkoss.zk.ui.Component parent)

Can only be Listhead

void

setSortAscending(java.lang.String)

Sets the ascending sorter with the class name, or null for no sorter for the ascending order.

void

setSortDescending(java.lang.String)

Sets the descending sorter with the class name, or null for no sorter for the descending order.

void

sort(boolean)

Sorts the rows (Row) based on getSortAscending() and getSortDescending(), if getSortDirection() doesn't matches the ascending argument.

boo lean

sort(boolean, boolean)

Sorts the rows (Row) based on getSortAscending() and getSortDescending().

boo lean

Inherited From