0

listbox columns resize problem (nativebar)

asked 2014-07-08 20:21:44 +0800

eduarded gravatar image eduarded
1 2

updated 2014-07-08 20:26:51 +0800

I have a problem in ZK 7.0.2 (also appeared in 7.0.0) - when resize listbox header, corresponding listcell also changing it's size. OK. But if I have a nativebar (especially vertical) - cell resizing is wrong

Sorry, I can't upload screenshot (not enough karma), but here is zul-file. So you need to resize columns to horizontal scrollbar appear

    <zk>
    <listbox id="box" multiple="true" height="130px">
<custom-attributes org.zkoss.zul.nativebar="true"/> <listhead sizable="true">
            <listheader label="Name"/>
            <listheader label="Gender"/>
            <listheader label="Age"/>
            <listheader label="Description"/>
        </listhead>
        <listitem>
            <listcell label="Mary"/>
            <listcell label="FEMALE"/>
            <listcell label="18"/>
            <listcell label="A young lady."/>
        </listitem>
        <listitem>
            <listcell label="John"/>
            <listcell label="MALE"/>
            <listcell label="20"/>
            <listcell label="A college student."/>
        </listitem>
        <listitem>
            <listcell label="Jane"/>
            <listcell label="FEMALE"/>
            <listcell label="32"/>
            <listcell label="A remarkable artist."/>
        </listitem>
        <listitem>
            <listcell label="John"/>
            <listcell label="MALE"/>
            <listcell label="20"/>
            <listcell label="A college student."/>
        </listitem>
        <listitem>
            <listcell label="Henry"/>
            <listcell label="MALE"/>
            <listcell label="29"/>
            <listcell label="A graduate."/>
        </listitem>
    </listbox>  
</zk>
delete flag offensive retag edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2014-07-18 09:15:59 +0800

Darksu gravatar image Darksu
1991 1 4

Hello eduarded,

In order for the column resize to work as expected, you should place the listbox in a window container as shown in the updated code bellow:

    <window title="listbox demo" border="normal" width="100%">
   <listbox id="box" multiple="true" height="130px">
    <listhead sizable="true">
            <listheader label="Name"/>
            <listheader label="Gender"/>
            <listheader label="Age"/>
            <listheader label="Description"/>
        </listhead>
        <listitem>
            <listcell label="Mary"/>
            <listcell label="FEMALE"/>
            <listcell label="18"/>
            <listcell label="A young lady."/>
        </listitem>
        <listitem>
            <listcell label="John"/>
            <listcell label="MALE"/>
            <listcell label="20"/>
            <listcell label="A college student."/>
        </listitem>
        <listitem>
            <listcell label="Jane"/>
            <listcell label="FEMALE"/>
            <listcell label="32"/>
            <listcell label="A remarkable artist."/>
        </listitem>
        <listitem>
            <listcell label="John"/>
            <listcell label="MALE"/>
            <listcell label="20"/>
            <listcell label="A college student."/>
        </listitem>
        <listitem>
            <listcell label="Henry"/>
            <listcell label="MALE"/>
            <listcell label="29"/>
            <listcell label="A graduate."/>
        </listitem>
    </listbox>  
</window>

The columns were not resized correctly because they did not have a parent container with configured dimensions (width).

Best Regards,

Darksu

link publish delete flag offensive edit
0

answered 2014-07-21 08:40:43 +0800

eduarded gravatar image eduarded
1 2

updated 2014-07-21 08:41:31 +0800

Thanks for the answer, Darksu. The problem exists only with a native scrollbar - don't delete <custom-attributes> and you will see, that the window container doesn't help

link publish delete flag offensive edit

Comments

It seems related to this known bug: http://tracker.zkoss.org/browse/ZK-2307. Can you try with latest 7.0.3 freshly version?

vincentjian ( 2014-07-31 04:14:42 +0800 )edit

It helped, yes, thanks

eduarded ( 2014-11-19 08:31:28 +0800 )edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
2 followers

RSS

Stats

Asked: 2014-07-08 20:21:44 +0800

Seen: 80 times

Last updated: Jul 21 '14

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More