作者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