Render on Demand to Show Huge Data with Grid and Listbox"
(Created page with "{{ZKDevelopersGuidePageHeader}} __TOC__ [ZK EE] [Since 5.0.0] With ZK EE, you can enable <b>Render on Demand</b> for Grid and Listbox to boost performance in showing huge ...") |
m (correct highlight (via JWB)) |
||
Line 14: | Line 14: | ||
=== ROD: Grid === | === ROD: Grid === | ||
− | If you want to enable Grid ROD for the whole application, you can specify a library property called <javadoc>org.zkoss.zul.grid</javadoc> rod with < | + | If you want to enable Grid ROD for the whole application, you can specify a library property called <javadoc>org.zkoss.zul.grid</javadoc> rod with <code>true</code>. For example, specify the following in zk.xml: |
<source lang="xml"> | <source lang="xml"> | ||
Line 23: | Line 23: | ||
</source> | </source> | ||
− | Or, if you prefer to enable it for a particular page, then specify < | + | Or, if you prefer to enable it for a particular page, then specify <code>true</code> to a page's attribute called <javadoc>org.zkoss.zul.grid</javadoc> rod, such as |
<source lang="xml"> | <source lang="xml"> | ||
Line 29: | Line 29: | ||
</source> | </source> | ||
− | Or, if you prefer to enable it for all descendant grids of a particular component, then specify < | + | Or, if you prefer to enable it for all descendant grids of a particular component, then specify <code>true</code> to the component's attribute. And, you can enable it for a subset of the descendant grids. For example, |
<source lang="xml"> | <source lang="xml"> | ||
Line 47: | Line 47: | ||
</source> | </source> | ||
− | Note that Grid ROD is not working unless the Grid is configured with a limited <b>view port</b>; i.e. you have to set < | + | Note that Grid ROD is not working unless the Grid is configured with a limited <b>view port</b>; i.e. you have to set <code>height</code> or <code>vflex</code> attribute of the Grid or set the Grid to <code>paging</code> mold so the user see only a portion of the content of the Grid. |
=== ROD: Listbox === | === ROD: Listbox === | ||
− | If you want to enable Listbox ROD for the whole application, you can specify a library property called <javadoc>org.zkoss.zul.listbox</javadoc> rod with < | + | If you want to enable Listbox ROD for the whole application, you can specify a library property called <javadoc>org.zkoss.zul.listbox</javadoc> rod with <code>true</code>. For example, specify the following in zk.xml: |
<source lang="xml"> | <source lang="xml"> | ||
Line 59: | Line 59: | ||
</source> | </source> | ||
− | Or, if you prefer to enable it for a particular page, then specify < | + | Or, if you prefer to enable it for a particular page, then specify <code>true</code> to a page's attribute called <javadoc>org.zkoss.zul.listbox</javadoc> rod, such as |
<source lang="xml"> | <source lang="xml"> | ||
Line 65: | Line 65: | ||
</source> | </source> | ||
− | Or, if you prefer to enable it for all descendant listboxs of a particular component, then specify < | + | Or, if you prefer to enable it for all descendant listboxs of a particular component, then specify <code>true</code> to the component's attribute. And, you can enable it for a subset of the descendant listboxs. For example, |
<source lang="xml"> | <source lang="xml"> | ||
Line 83: | Line 83: | ||
</source> | </source> | ||
− | Note that Listbox ROD is not working unless the Listbox is configured with a limited <b>view port</b>; i.e. you have to set < | + | Note that Listbox ROD is not working unless the Listbox is configured with a limited <b>view port</b>; i.e. you have to set <code>height</code>, <code>vflex</code>, or <code>rows</code> attribute of the Listbox or set the Listbox to <code>paging</code> mold so the user see only a portion of the content of the Listbox. |
{{ ZKDevelopersGuidePageFooter}} | {{ ZKDevelopersGuidePageFooter}} |
Latest revision as of 10:35, 19 January 2022
This documentation is for an older version of ZK. For the latest one, please click here.
[ZK EE] [Since 5.0.0]
With ZK EE, you can enable Render on Demand for Grid and Listbox to boost performance in showing huge data. Grid and Listbox will load only the necessary data chunk from associated ListModel, render required Row(s)/Listitem(s) in server, then create only required corresponding widgets and render the DOM elements really needed in browser. It improves the performance and saves memory significantly in both server and browser sides.
ROD: Grid
If you want to enable Grid ROD for the whole application, you can specify a library property called grid rod with true
. For example, specify the following in zk.xml:
<library-property>
<name>org.zkoss.zul.grid.rod</name>
<value>true</value>
</library-property>
Or, if you prefer to enable it for a particular page, then specify true
to a page's attribute called grid rod, such as
<custom-attributes org.zkoss.zul.grid.rod="true" scope="page"/>
Or, if you prefer to enable it for all descendant grids of a particular component, then specify true
to the component's attribute. And, you can enable it for a subset of the descendant grids. For example,
<window>
<custom-attributes org.zkoss.zul.grid.rod="true"/> <!-- enable it for descendant grids of window -->
<grid ...>
..
</grid>
<div>
<custom-attributes org.zkoss.zul.grid.rod="false"/> <!-- disable it for descendant grids of div -->
<grid ...>
..
</grid>
..
</div>
</window>
Note that Grid ROD is not working unless the Grid is configured with a limited view port; i.e. you have to set height
or vflex
attribute of the Grid or set the Grid to paging
mold so the user see only a portion of the content of the Grid.
ROD: Listbox
If you want to enable Listbox ROD for the whole application, you can specify a library property called listbox rod with true
. For example, specify the following in zk.xml:
<library-property>
<name>org.zkoss.zul.listbox.rod</name>
<value>true</value>
</library-property>
Or, if you prefer to enable it for a particular page, then specify true
to a page's attribute called listbox rod, such as
<custom-attributes org.zkoss.zul.listbox.rod="true" scope="page"/>
Or, if you prefer to enable it for all descendant listboxs of a particular component, then specify true
to the component's attribute. And, you can enable it for a subset of the descendant listboxs. For example,
<window>
<custom-attributes org.zkoss.zul.listbox.rod="true"/> <!-- enable it for descendant listboxs of window -->
<listbox ...>
..
</listbox>
<div>
<custom-attributes org.zkoss.zul.listbox.rod="false"/> <!-- disable it for descendant listboxs of div -->
<listbox ...>
..
</listbox>
..
</div>
</window>
Note that Listbox ROD is not working unless the Listbox is configured with a limited view port; i.e. you have to set height
, vflex
, or rows
attribute of the Listbox or set the Listbox to paging
mold so the user see only a portion of the content of the Listbox.