<zk>
<zscript><![CDATA[
import org.zkoss.zul.*;
TreeModel model = new DefaultTreeModel(
new DefaultTreeNode(null, new DefaultTreeNode[] {
new DefaultTreeNode("item 0"),
new DefaultTreeNode("item 1"),
new DefaultTreeNode("item 2")
})
);
TreeitemRenderer renderer = new TreeitemRenderer() {
public void render(Treeitem item, Object data) throws Exception {
TreeNode node = (TreeNode) data;
item.setLabel(node.getData().toString());
}
};
]]></zscript>
<tree width="300px" itemRenderer="${renderer}" model="${model}">
<custom-attributes org.zkoss.zul.tree.autoSort="true"/>
<treecols>
<treecol label="col" sort="auto" sortDirection="ascending" />
</treecols>
</tree>
</zk>