Use Live Data and Paging"

From Documentation
m (remove empty version history (via JWB))
 
(12 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{ZKDevelopersGuidePageHeader}}
+
{{ZKDevelopersReferencePageHeader}}
  
Sending out a list box with a lot of items to the client is expensive. In addition, the JavaScript engine of the browser is not good for initializing a list box with a lot of items. A better solution is to use the live data, i.e., by assigning a list model to it. Then, the list items are sent to the client only if they become visible.
+
Sending out a listbox/grid/tree with a lot of items to the client is expensive. In addition, the JavaScript engines of some browsers are not good for initializing a listbox/grid/tree with a lot of items. A better solution is to use the live data, i.e., by assigning a model (such as <javadoc type="interface">org.zkoss.zul.ListModel</javadoc>) to it. Then, the items are sent to the client only if they become visible.
  
The performance will be improved more if you also use the paging mold.
+
In addition, the performance will be improved more if you also use the paging mold such as
  
Refer to the '''List Boxes''' section in the [http://books.zkoss.org/wiki/ZK_Component_Reference ZK Component Reference] chapter for more details.
+
<source lang="xml">
 +
<listbox model="${mymodel}" mold="paging">
 +
...
 +
</source>
  
 +
For more information of using and implementing a model, please refer to [[ZK Developer's Reference/MVC/Model|the Model section]]
 +
and [[ZK_Component_Reference/Data/Listbox#Live_Data|ZK Component Reference: Listbox]].
  
{{ ZKDevelopersGuidePageFooter}}
+
 
 +
 
 +
{{ ZKDevelopersReferencePageFooter}}

Latest revision as of 10:23, 5 February 2024

Sending out a listbox/grid/tree with a lot of items to the client is expensive. In addition, the JavaScript engines of some browsers are not good for initializing a listbox/grid/tree with a lot of items. A better solution is to use the live data, i.e., by assigning a model (such as ListModel) to it. Then, the items are sent to the client only if they become visible.

In addition, the performance will be improved more if you also use the paging mold such as

<listbox model="${mymodel}" mold="paging">
...

For more information of using and implementing a model, please refer to the Model section and ZK Component Reference: Listbox.




Last Update : 2024/02/05

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