开发者

A GWT CellTable with frozen header and initial column

开发者 https://www.devze.com 2023-01-22 19:14 出处:网络
I need to freeze the first column and first row of data in a CellTable, so that users can scroll through the data but still see the labels on the \"axes.\"The first column should scroll when the user

I need to freeze the first column and first row of data in a CellTable, so that users can scroll through the data but still see the labels on the "axes." The first column should scroll when the user scrolls up and down, and the header row should scroll when the user scrolls left and right. Think "Freeze Panes" in Excel.

I'm using GWT 2.1 and am willing to write my own widget to do this if no solutions already exist. My question is a two-parter:

  1. Do any开发者_如何学Go widgets already have this behavior?
  2. Any suggestions if I'm going to implement this myself?

Thanks!


I implemented a solution myself. Check out http://larkolicio.us/ScrollTable/ExperimentTables.html

It's a LayoutPanel with three AbsolutePanels inside it. The frozen columns are a CellTable, the main part is a CellTable, and the header is a Grid - I could find no way to set the width of a CellTable column! A ScrollHandler links the main part to the two frozen parts. There is a little bit of delay - I'd appreciate it if someone could find a way to get rid of the lag between the sections.

I got it working to a point that I could use it, and stopped. It is not a general-purpose widget. Please feel free to use it at your own risk.


This implementation is quite good. I have just tested it. It however needs some changes made to support asynchronous loading. GWT Issue 188 covering similar request for enhacement was created on Oct 2006?!

Thanks for sharing.

0

精彩评论

暂无评论...
验证码 换一张
取 消