0

Problem perform zul data transfer to client side

asked 2015-10-09 15:43:04 +0800

roma2907 gravatar image roma2907
11 1

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.

delete flag offensive retag edit

Comments

What Java script error do you have?

chillworld ( 2015-10-10 06:19:50 +0800 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-10-09 17:18:12 +0800

Darksu gravatar image Darksu
1991 1 4

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

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2015-10-09 15:43:04 +0800

Seen: 22 times

Last updated: Oct 09 '15

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More