-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi,
I got some problems by getting the height of a component.
Example:
The component is a listbox with vflex="1".
My target is now to calculate the amount of listitem's that i can display within this listbox without scrolling.
In order to do that i will need the current height of the listbox .
Is there any event I can register in order to get the height of the component.
The only size event i get working is the ClientInfoEvent, this delivers only the total desktop heigth. But if i got nested elements this is not really good.
Is there any solution for this?
Thanks in advance.
Hi, orism
If you don't want to display the listbox without scrolling.
you can try this sample
<zk> <zscript><![CDATA[ String[] data = new String[5]; for (int j = 0; j < data.length; ++j) { data = "option " + j; } ListModel strset = new ListModelList(data); void change(int num) { String[] data = new String; for (int j = 0; j < data.length; ++j) { data = "option " + j; } listbox.setModel(new ListModelList(data)); } ]]></zscript> <button label='10' onClick='change(10)' /> <button label='20' onClick='change(20)' /> <button label='30' onClick='change(30)' /> <listbox id="listbox" width="200px" model="${strset}"> <listhead> <listheader label="Load on demend" /> </listhead> </listbox> </zk>
Asked: 2010-03-04 07:31:33 +0800
Seen: 258 times
Last updated: Mar 07 '10