-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi, I have faced some odd behaviour of Frozen component when I put the entire grid in a div with align="center". When I try to scroll the horizontal scroll bar then the fixed columns are coming into the center of the grid. I don't know whether this is the expected behaviour or not. My expectation is the center alignment is for the entire grid but not for the columns.
Below is the sample example which is causing the issue. If I remove that center alignment it is working fine.
<div align="center">
<grid width="600px" >
<frozen columns="2" start="1"/>
<columns>
<column width="50px">ID</column>
<column width="50px">Priority</column>
<column width="50px">Status</column>
<column width="150px">Summary</column>
<column width="250px">Detail</column>
<column width="100px">Group</column>
<column width="50px">Assign</column>
</columns>
<rows>
<row>
<cell>0001</cell>
<cell>1</cell>
<cell>closed</cell>
<cell>Fix login issue</cell>
<cell>Login does not work at all</cell>
<cell>Account</cell>
<cell>Bob</cell>
</row>
<row>
<cell>0002</cell>
<cell>3</cell>
<cell>open</cell>
<cell>Button style broken</cell>
<cell>Check main.css</cell>
<cell>Styling</cell>
<cell>Alice</cell>
</row>
<row>
<cell>0003</cell>
<cell>2</cell>
<cell>open</cell>
<cell>Client search result</cell>
<cell>Search service returns incomplete result</cell>
<cell>Service</cell>
<cell>Bob</cell>
</row>
</rows>
</grid>
</div>
dpchandra
Hello dpchandra,
Indeed it seems there is an issue when you are using div.
Instead you could use an hbox which is a much better layout component that zk offers.
In detail replace the code <div align="center">
with <hbox align="center" pack="center" hflex="1" vflex="1">
and you will see that the grid will work as expected.
Best Regards,
Darksu
Asked: 2014-07-10 09:36:17 +0800
Seen: 32 times
Last updated: Jan 06 '15