0

Container scroll bar jumps when I page through the values of the last grid

asked 2011-10-21 08:56:04 +0800

digulla gravatar image digulla
502 4

I have a borderlayout with a big center component that has autoscroll=true. The main components in the center are grids which use paging.

This works for all grids but the last one: When I page through grid1 and grid2, the scrollbar doesn't jump.

When I try to page in the bottom grid, the scrollbar will jump up, so the last grid won't be completely visible anymore. How do I fix that?

Demo code:

<?page title="Demo for Paging Scroll Bag" contentType="text/html;charset=UTF-8"?>
<zk>
<zscript><![CDATA[

    List data = new ArrayList();
    for( int i=1; i<101; i++ ) {
        data.add( "Row " + i );
    }

]]></zscript>
<window title="Demo for Paging Scroll Bag" border="normal" width="400px" height="450px">
    <borderlayout>
    	<center autoscroll="true">
    		<vbox width="100%">
				<grid id="grid1" mold="paging" pageSize="10">
					<columns>
						<column>Data</column>
					</columns>
				</grid>
				
				<grid id="grid2" mold="paging" pageSize="10">
					<columns>
						<column>Data</column>
					</columns>
				</grid>
				
				<grid id="grid3" mold="paging" pageSize="10">
					<columns>
						<column>Data</column>
					</columns>
				</grid>
    		</vbox>
    	</center>
    </borderlayout>
<zscript><![CDATA[

    grid1.setModel( new ListModelList( data ) );
    grid2.setModel( new ListModelList( data ) );
    grid3.setModel( new ListModelList( data ) );

]]></zscript>
</window>
</zk>

delete flag offensive retag edit

4 Replies

Sort by ยป oldest newest

answered 2011-10-21 08:59:59 +0800

digulla gravatar image digulla
502 4

Update: When I add a div below the last grid with a height of at least 300px, the effect stops (or gets much better).

My guess is that the grid changes size while the new page is built and the position of the scrollbar adjusts. A similar effect happens when I page through the second grid when it's scrolled out at the top.

link publish delete flag offensive edit

answered 2011-11-01 08:30:09 +0800

jumperchen gravatar image jumperchen
3909 2 8
http://jumperchen.blogspo... ZK Team

You may specify a precise height for the grid to avoid jumping scrollbar.

link publish delete flag offensive edit

answered 2011-11-02 08:39:18 +0800

digulla gravatar image digulla
502 4

How do I know the "best" height to use?

link publish delete flag offensive edit

answered 2011-11-10 09:47:37 +0800

jumperchen gravatar image jumperchen
3909 2 8
http://jumperchen.blogspo... ZK Team

It depends on the content, but it is hard to guess.

link publish delete flag offensive edit
Your reply
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

RSS

Stats

Asked: 2011-10-21 08:56:04 +0800

Seen: 298 times

Last updated: Nov 10 '11

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