Renderer"
From Documentation
(Created page with "{{ZKDevelopersReferencePageHeader}} A renderer is a Java class that is used to render the items specified in a data model<ref>If you prefer to define the rendering of each item ...") |
RebeccaLai (talk | contribs) m |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
{{ZKDevelopersReferencePageHeader}} | {{ZKDevelopersReferencePageHeader}} | ||
− | A renderer is a Java class that | + | A '''renderer''' is a Java class that produces child items based on a data model. It renders your data into View. There are 2 kinds of renderers: |
+ | |||
+ | #. Render child components: like <javadoc type="interface">org.zkoss.zul.ListitemRenderer</javadoc>, <javadoc type="interface">org.zkoss.zul.RowRenderer</javadoc> | ||
+ | #. Render HTML snippets: <javadoc type="interface">org.zkoss.zul.ItemRenderer</javadoc>. | ||
+ | |||
+ | The implementation of a renderer depends on the component. For example, the display of <javadoc>org.zkoss.zul.Listbox</javadoc> can be customized by an implementation of <javadoc type="interface">org.zkoss.zul.ListitemRenderer</javadoc>, and <javadoc>org.zkoss.zul.Grid</javadoc> by <javadoc type="interface">org.zkoss.zul.RowRenderer</javadoc>. | ||
+ | |||
+ | If you prefer to define the rendering of each item in the ZUML document, you can use [[ZK Developer's Reference/MVC/View/Template|templates]] instead. | ||
− | |||
− | |||
− | |||
− | |||
{{ZKDevelopersReferenceHeadingToc}} | {{ZKDevelopersReferenceHeadingToc}} | ||
{{ZKDevelopersReferencePageFooter}} | {{ZKDevelopersReferencePageFooter}} |
Latest revision as of 02:59, 30 January 2024
A renderer is a Java class that produces child items based on a data model. It renders your data into View. There are 2 kinds of renderers:
- . Render child components: like ListitemRenderer, RowRenderer
- . Render HTML snippets: ItemRenderer.
The implementation of a renderer depends on the component. For example, the display of Listbox can be customized by an implementation of ListitemRenderer, and Grid by RowRenderer.
If you prefer to define the rendering of each item in the ZUML document, you can use templates instead.