-
FEATURED COMPONENTS
First time here? Check out the FAQ!
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>
It depends on the content, but it is hard to guess.
You may specify a precise height for the grid to avoid jumping scrollbar.
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.
Asked: 2011-10-21 08:56:04 +0800
Seen: 298 times
Last updated: Nov 10 '11