-
FEATURED COMPONENTS
First time here? Check out the FAQ!
In most other grids I've come across (e.g. the ExtJS grid), the column headers remain fixed or stationary as you scroll the grid contents. This is similar behavior to the native widgets in a typical GUI app. But it's nice to see the column headers as you're scrolling so you can easily see which column is what. If there's not some option to enable it, I can imagine how much work it would be to introduce it to the grid.
I would like to "freeze" both the column and row headers. I believe column headers work the way you would like by setting the height of the grid.
To answer iantsai, a "list" of things is fine to page through, but anything that is more like a spreadsheet in presentation is nice to scroll through.
/Daryl
iantsai - I think the question must have been a bit confusing. I'm not asking how to page my data, I'm asking if there's a way for the grid (or listbox) column headers to stay where they are as you scroll vertically. Paging doesn't matter - if my page size is 100 records and they don't all fit in the grid's viewport, you'll have to scroll vertically to see them all. As you're scrolling, it would be nice if the column headers always remained visible. Currently, I have to scroll all the way to the top of the list to see which column is what.
dastultz - I've set the height of the grid explicitly and it still doesn't do it. )c: I'm thinking the ZK grid just doesn't support it.
davidhoyt,
I think you are mistaken. ZK DEFINITELY supports the content-scrolling with fixed column headers. As a matter of fact, I don't think you have a choice of NOT fixing the headers if you scroll the grid content. Set the height="...px" will make the scrollbar appear for the content only. Maybe you can post some sample code to show that it doesn't work this way?
@dastultz, Yes, freezing a particular column when scrolling horizontally is a great feature to have. Hope ZK grid can implement that someday.
@ davidhoyt,
Yes. As jj mentioned, ZK Grid supports the fixed column header. You can refer this live demo: Grid (Live Grouping).
http://www.zkoss.org/zkdemo/userguide/#g5
You're absolutely right.
Does the grid, by default, expand to the size of its container or its contents? I ask b/c I have it in a <borderlayout /> as the only child of a <center />. I expect <borderlayout /> to size it correctly, setting the width/height of the grid to the viewport width/height, therefore causing it to scroll. But if it's not sizing the grid and instead the grid is just expanding (therefore using the <center />'s autoscroll), then that could be the problem.
Asked: 2009-07-17 17:53:58 +0800
Seen: 484 times
Last updated: Jul 27 '09