-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I did some experiments to have a page which is fully resizable. To achieve this, I use hflex like in the following two examples:
A window with a scrollable div containing a listbox:
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" arg0="./win"?> <?page title="Scrollable Div with a listbox" contentType="text/html;charset=UTF-8"?> <window id="win" border="none" height="100%" width="100%"> <div style="overflow:auto" height="100%" width="100%" vflex="1"> <listbox id="qssList" rows="10" hflex="1"> <listhead> <listheader label="Col1" /> <listheader label="Col2" width="70px" /> <listheader label="Col3" width="70px" /> <listheader label="Col4" width="70px" /> <listheader label="Col5" width="200px" /> </listhead> </listbox> </div> </window>
The same, but with a grid instead of a listbox:
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" arg0="./win"?> <?page title="Scollable div with a grid" contentType="text/html;charset=UTF-8"?> <window id="win" border="none" height="100%" width="100%"> <div style="overflow:auto" height="100%" width="100%" vflex="1"> <grid zclass="none" hflex="1"> <columns> <column width="120px" /> <column /> <column width="120px" /> <column /> </columns> <rows> <row> <label value="Label1:" /> <textbox maxlength="6" width="100px" /> <label value="Label2:" /> <datebox width="100px" format="dd.MM.yyyy" /> </row> <row spans="1,3"> <label value="Label5:" /> <div id="div5" /> </row> <row> <label value="Label6:" /> <datebox width="100px" format="dd.MM.yyyy" /> <label value="Label7:" /> <checkbox /> </row> <row spans="1,3"> <label value="Label7:" /> <hbox align="center" pack="stretch"> <intbox cols="3" width="30px" /> <label value="label8" /> </hbox> </row> </rows> </grid> </div> </window>
In both cases, resizing the page works quite nice. Now shrink the vertical space until the vertical scrollbar appears.
In the same moment, also the horizontal scrollbar is displayed.
My guess: hflex calculates the width without taking a vertical scrollbar into account.
Any ideas how to solve this?
Asked: 2011-02-15 14:40:48 +0800
Seen: 180 times
Last updated: Feb 18 '11