-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi, I have a javascript problem when i have lots of data which are displayed in a grid inside another grid. I show you a tiny example. I want that each component of the grid is connect to an other element (connect with css border).
<?page title="Auto Generated index.zul"?>
<zk >
<zscript><![CDATA[
ListModelList lm = new ListModelList();
for (int i = 0; i < 800; i++) {
lm.add(i);
}
]]></zscript>
<style>
.z-cell.bottom{
border-bottom:1px solid green;
}
.z-cell.left{
border-left:1px solid green;
}
.z-cell.left-bottom{
border-left: 1px solid green;
border-bottom:1px solid green;
}
.border{
border:1px solid black;
text-align:center;
}
</style>
<grid>
<columns>
<column width="15%" />
<column width="15%" />
<column width="15%" />
<column width="15%" />
<column width="10%" />
<column width="15%" />
<column width="15%" />
</columns>
<rows>
<row>
<cell colspan="2" class="border">
<label value="test" />
</cell>
</row>
</rows>
</grid>
<grid model="${lm}">
<columns>
<column hflex="1" />
</columns>
<template name="model">
<row>
<grid hflex="1">
<columns>
<column width="15%" />
<column width="15%" />
<column width="15%" />
<column width="15%" />
<column width="10%" />
<column width="15%" />
<column width="15%" />
</columns>
<rows>
<row height="16px">
<cell />
<cell class="left" />
</row>
<row height="10px">
<cell />
<cell class="left" />
</row>
<row height="10px">
<cell />
<cell class="left" />
</row>
<row height="16px">
<cell />
<cell class="left-bottom" />
<cell class="bottom"></cell>
<cell class="bottom"></cell>
<cell class="bottom" />
<cell colspan="2" rowspan="2" class="border">
<label value="${each}" />
</cell>
</row>
<row height="16px"></row>
</rows>
</grid>
</row>
</template>
</grid>
</zk>
I don't know how I can optimize that. I would like to reduce the weight of the zul data transfer to the client side to haven't javascript error.
Hello roma2907,
First of all you should check out the following step by step trouble shooting
http://books.zkoss.org/wiki/ZKDeveloper'sReference/PerformanceMonitoring/StepbyStepTrouble_Shooting
Furthermore you should consider changing to a MVC or MVVM model and use paging, render on demand, and custom model's to improve the performance.
Best Regards,
Darksu
Asked: 2015-10-09 15:43:04 +0800
Seen: 22 times
Last updated: Oct 09 '15
What Java script error do you have?
chillworld ( 2015-10-10 06:19:50 +0800 )edit