From Documentation

Jump to: navigation, search

Implementing a custom renderer for a Cascader (ItemRenderer) is straightforward[1]:

public class FooItemRenderer implements org.zkoss.zul.ItemRenderer {
    public String render(Component owner, Object data, int index) throws Exception {
        return data.toString(); //converting data to a string; it depends on your application's requirement

Assume we have a tree model (TreeModel) called district, and an instance of a custom renderer called districtRenderer, we can put them together in a ZUML document as follows:

<cascader model="${district}" itemRenderer="${districtRenderer}"/>

  1. For the concepts about component, model and renderer, please refer to the Model-driven Display section.

Version History

Last Update : 2019/11/19

Version Date Content
9.0.0 November 2019 ZK-4392: Provide a cascader component

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.