作者lovdkkkk (dk)
看板Ajax
標題Re: [問題] ZK listbox 如何顯示 scroll bar
時間Mon Dec 10 21:21:12 2012
※ 引述《wxyy (裝笑幃)》之銘言:
: 底下這段
: <window height="120px" border="normal">
: <hbox height="100%">
: <listbox height="120px"> <!-- 高度:120px 有 scroll bar -->
: <listitem forEach="a, b, c, d, e, f, g" label="${each}"/>
: </listbox>
: <listbox height="100%"> <!-- 高度: 100% 沒有 scroll bar -->
: <listitem forEach="1, 2, 3, 4, 5, 6, 7" label="${each}" />
: </listbox>
: </hbox>
: </window>
: 顯示結果
: http://ppt.cc/uYr1
: 我想用高度 100% 的 listbox, 要如何才能正確的顯示 scroll bar ???
因為 ZK 有真正去算 Component 的 Size 的屬性是 hflex/vflex,
用 % width/height 的話只是簡單的給在 root element 上面,
建議使用 hflex/vflex 取代百分比的 width/height,
參考資料
http://books.zkoss.org/wiki/ZK_Developer's_Reference/UI_Patterns/Hflex_and_Vflex
縮
http://ppt.cc/cX2j
sample at zkfiddle
http://zkfiddle.org/sample/2ovduhc/2-ZK-listbox-size-scroll
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 118.168.1.69
1F:→ TonyQ:可以的話還是建議直接給定高度啦 XD vflex 有他的麻煩。 12/11 01:00
2F:→ lovdkkkk:嗯嗯, 尤其是在 listbox, grid 或 tree 這些東西上 12/11 07:41
3F:推 wxyy:謝謝, 搞定了... 12/11 10:40