-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi,
When setting more than one column span in listbox it doesn't spans all columns just the first.
In <listbox sizedByContent="true" span="1,2"> only column 1 spans.
Is that normal?
Thank you!
Hi senthilchettyin,
I have updated the original sample from fiddle
<zk>
<window border="normal" title="hello">
<listbox span="1,2,3">
<listhead>
<listheader label="Column 1"/>
<listheader label="Column 2"/>
<listheader label="Column 3"/>
<listheader width="100px" label="Column 4"/>
<listheader width="100px" label="Column 5"/>
</listhead>
<listitem>
<listcell label="Cell 1"/>
<listcell label="Cell 2"/>
<listcell label="Cell 3"/>
<listcell label="Cell 4"/>
<listcell label="Cell 5"/>
</listitem>
</listbox>
</window>
</zk>
Here an example because it is still happening.
<zk>
<window border="normal" title="hello">
<listbox sizedByContent="true" span="1,2,3">
<listhead>
<listheader label="Column 1"/>
<listheader label="Column 2"/>
<listheader label="Column 3"/>
<listheader label="Column 4"/>
<listheader label="Column 5"/>
</listhead>
<listitem>
<listcell label="Cell 1"/>
<listcell label="Cell 2"/>
<listcell label="Cell 3"/>
<listcell label="Cell 4"/>
<listcell label="Cell 5"/>
</listitem>
</listbox>
</window>
</zk>
According to documentation, there are two modes.
(a) If you use sizeByContent, you can only specifiy span=true.
(b) If you use defined widths for columns, you can specify span=true, or assign a span to a specific column.
I haven't found anything about passing more than one column. But I use option (b) frequently.
According to the API a column can be assigned to span (http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zul/impl/MeshElement.html#setSpan(java.lang.String)). I think I read that it allows more than one column also. In fact, I'm using it in a grid and all columns that I indicate are spaned. But I never tried it with a listbox and now I realize that it is not working. I don't know if it doesn't work because it only supports one column or because it is working wrong.
Hi Neus
If you arrived the desired output, can you please share the modify code ?
Asked: 2012-04-10 06:56:16 +0800
Seen: 197 times
Last updated: Apr 26 '12