Export to GitHub

google-web-toolkit - issue #188

Grid with scrollable data area


Posted on Oct 4, 2006 by Swift Camel

GWT Release:

Detailed description: It would be very nice to have a grid component with header and data area, and latter is vertically scrollable (by scrollbar) independently from the whole component. It occurs that it is not so easy to emulate such behavior with existing GWT components.

Workaround if you have one:

Links to the relevant GWT Developer Forum posts:

Comment #1

Posted on Oct 27, 2006 by Happy Camel

I like this

Comment #2

Posted on Nov 15, 2006 by Swift Panda

(No comment was entered for this change.)

Comment #3

Posted on Nov 16, 2006 by Swift Panda

It is possible to do this currently using two tables, with one in a ScrollPanel. The hard parts are:

(a) getting the header's columns to resize to match the body's columns' widths. (b) getting the header to scroll horizontally with the body, but without scrollbars.

The latter of these can be addressed by syncing the ScrollPanel's scrollLeft with the header's margin-left (negated). The former will probably require a bit more research.

Given that this is, in fact, a bit tricky, I think it's probably a good idea to build it in gwt-user.

Comment #4

Posted on Dec 14, 2006 by Helpful Ox

A non scrollable table with both header and footer, accepting and widgets and events, would be excellent.

ie: scrollable can be left for a later date.

Riyaz

Comment #5

Posted on Dec 14, 2006 by Happy Lion

Given that a table is essentially three distinct sections (two of which are optional) should the TableListener classes respond to three different types of events? ie. onHeadCellClicked onBodyCellClicked onFootCellClicked or simply dealt with in the generic onCellClicked with an Element rider that defines the section of the table?

I only ask as a point of discussion, as dealing with the sections as independent response paths or not will define how rows and cells are added (eg. addRow(Element section) or addHeadRow) etc.

Comment #6

Posted on Feb 1, 2007 by Happy Bird

Bumping to Pri-High b/c this work is already under way.

Comment #7

Posted on Feb 14, 2007 by Massive Rabbit

Want to do this, but need more time to get it right than is available before 1.4.

Comment #8

Posted on Apr 9, 2007 by Grumpy Ox

It also would be really good if you could sort the data by clicking on the column.

Comment #9

Posted on May 29, 2007 by Swift Giraffe

It would also help me a lot if there was a table/grid widget that has a column resizing feature.

Comment #10

Posted on Aug 7, 2007 by Grumpy Wombat

(No comment was entered for this change.)

Comment #11

Posted on Aug 8, 2007 by Swift Camel

Some kind of such grids exist in the GWT-EXT, see http://gwt-ext.googlecode.com/. May be they can be incorporated directly in GWT?

Regards, Oleksandr

Comment #12

Posted on Sep 17, 2007 by Grumpy Wombat

Please take a look at the ScrollableTable in the GWT Incubator and let me know if you have any feedback: http://code.google.com/p/google-web-toolkit-incubator/wiki/ScrollTable

The incubator is the proving ground for new GWT components, so if we get good responses, we will try to incorporate it into a future build.

Comment #13

Posted on Oct 2, 2007 by Quick Bear

Comment deleted

Comment #14

Posted on Oct 2, 2007 by Quick Bear

Comment deleted

Comment #15

Posted on Oct 2, 2007 by Quick Bear

The ScrollableTable in the GWT Incubator is nice, but I realy prefer the solution of the GWT-EXT project. Is there any possibilty to have a strong toolkit out of these two projects?

Comment #16

Posted on Nov 3, 2007 by Quick Panda

For the last couple of days I worked with ScrollTable and other tables from GWT Incubator and generally I am happy with it. Though some things (like sorting for example) need to be improved and made more friendly (for example it would be good to have possibility to set custom column comparators and ideally support some set of standard comparators for common types).

Comment #17

Posted on Nov 21, 2007 by Quick Ox

the demo in the incubator does not work in any browser that honors the text/plain content type that the index.html page is being served as. (Such browsers show the html source rather than interpreting it.)

Comment #18

Posted on Feb 4, 2008 by Helpful Elephant

I would be great to have resizable column and multi column sorting table.

Comment #19

Posted on Feb 8, 2008 by Happy Bird

Feel free to look at the ScrollTable in the incubator. We are continously improving it based on user feedback. Many issues have been addressed (though the demo hasn't been updated recently), and some new features have been added, such as multi column sorting.

http://code.google.com/p/google-web-toolkit-incubator/wiki/ScrollTable

I'll update the demo very soon as the current demo doesn't do it justice.

Comment #20

Posted on Feb 20, 2008 by Swift Giraffe

ScrollTable is a really good widget and it covers almost everything I'm looking for!! It would also be great to have a column picker just above the vertical scroll bar, one very similar to Thunderbird.

Comment #21

Posted on Apr 29, 2008 by Happy Bird

(No comment was entered for this change.)

Comment #22

Posted on May 30, 2008 by Happy Kangaroo

What do you think about a RPC feature for the ScrollableTable.

Think of a table with one million rows. wouldn't it be nice to fech data from the server when needed and display it to the user ?

Do you think it could be implemented ?

Comment #23

Posted on May 30, 2008 by Happy Bird

Check out the PagingScrollTable. Its designed to divide the rows into pages, and you can implement a TableModel that will grab data from a server on demand.

The other option that I've seen is a table with a fake scroll bar. When the user scrolls down to the 300,000th row, the client fetches the data from the server and shows the visible rows. We don't have any plans to add this particular feature, but it may be an possibility in the future.

Comment #24

Posted on Aug 19, 2008 by Quick Ox

We are currently searching for a grid, which has a scrollable area, a left area (only vertical scrolling) und a top area (only horizontal scrolling). i attached a "screenshot" of what we are searching for...

Attachments

Comment #25

Posted on Oct 21, 2008 by Helpful Lion

(No comment was entered for this change.)

Comment #26

Posted on May 7, 2009 by Helpful Giraffe

Will this scrollable grid support sorting and grouping of data?

Comment #27

Posted on May 7, 2009 by Happy Bird

That PagingScrollTale in incubator supports sorting.

What do you mean by grouping? You can customize the rendering of rows based on the associated row value, so you could group things using styles. However, there is no formal support for groups of rows.

Comment #28

Posted on May 7, 2009 by Quick Ox

The PagingScrollTable in the incubator does support sorting; I have used it in an application.

In my case, since I'm using both sorting (by column) and paging, I wanted to do the sorting on the server side.
You could sort on the client-side if you wanted, but I didn't want to send more data to the browser than was necessary.

To use the PagingScrollTable, you'll need to extend the TableModel class, which has a method called requestRows() that you override:

    public void requestRows(final Request request, final Callback<T> callback) {
    }

In the body of this method, you can interrogate the 'request' object to find out how many items you need to fetch, and which column you're sorting by. You can then take that information and call some RPC that gets exactly those rows, sorted in the appropriate manner.

Then, in the onSuccessSub() of that RPC, you tell the callback object that the rows are ready.

I highly recommend wrapping your mind around PagingScrollTable. It works well.

Comment #29

Posted on May 28, 2009 by Happy Bear

See http://advanced-gwt.sourceforge.net

Comment #30

Posted on Jun 1, 2009 by Quick Hippo

http://www.seozap.com http://www.mindalbum.com

Comment #31

Posted on Dec 11, 2009 by Massive Monkey

I tested the PagingScrollTable from the incubator and I like it (of course it needs some work). Will it be available in the next GWT release? And I noticed that the subversion repo contains a folder (svn/changes/jlabanca/scrolltable) in which the table is being merged with GWT. I was wandering if it is a more advanced/refined version than the one in the incubator.

Comment #32

Posted on Oct 22, 2010 by Swift Monkey

Will CellTable, the new way of doing grids since GWT 2.1, support sorting?

Comment #33

Posted on Oct 22, 2010 by Massive Cat

It doesn't have built in sorting capability, but its designed to handle it.

You can push data into CellTable from a data provider/model, so you can easily push sorted data. CellTable Headers can handle events, so you can create a SortableHeader that responds to click events and tells your data provider to provide sorted information to the table.

In a future version, we'll look into creating a more full featured CellTable that supports sorting, but it will be a while (months) before we start working on it.

Comment #34

Posted on Nov 2, 2010 by Quick Ox

As far as I know the CellTable does not support scrolling with fixed headers or columns at all.

Comment #36

Posted on Jan 13, 2011 by Swift Ox

(No comment was entered for this change.)

Comment #37

Posted on May 24, 2011 by Massive Cat

http://gwt-code-reviews.appspot.com/1450805

Comment #38

Posted on May 25, 2011 by Quick Ox

I see that scrolling and fixed headers are now implemented ... but what about resizable columns ? We use that feature in the incubator and we can not migrate until the CellTable also supports this.

Comment #39

Posted on May 25, 2011 by Massive Cat

Can you create a separate issue for resizeable columns? This issue originally started as a scrollable table, and I don't want to have one issue become a list of multiple table features.

FYI - I intentionally excluded user column resizing from CellTable for now. PagingScrollTable in incubator uses active column resizing when the window size changes, which is too slow. There may be ways to implement column resizing in CellTable without active layout, but it will take some experimenting to make sure it can be done efficiently without active layout.

Comment #40

Posted on May 25, 2011 by Quick Ox

Ok, I created a different issue for resizing of the header here: http://code.google.com/p/google-web-toolkit/issues/detail?id=6401

Comment #41

Posted on May 26, 2011 by Massive Cat

4.5 years later...

Comment #42

Posted on May 26, 2011 by Happy Giraffe

Nice. I just wanted to say thanks to everyone that contributed to this enhancement.

Comment #43

Posted on Jun 17, 2011 by Helpful Monkey

(No comment was entered for this change.)

Comment #44

Posted on Jun 17, 2011 by Quick Ox

Moving Fixed -> FixedNotReleased since 2.4 hasn't shipped yet.

Comment #45

Posted on Jul 17, 2011 by Grumpy Cat

What exactly was the Fix made in 2.4?

I would be looking for a grid which supports both vertical and horizontal scrolling. Does the 2.4 release fix provide is and if so which widget(s)?

Thanks

Comment #46

Posted on Jul 20, 2011 by Massive Cat

The new DataGrid widget supports vertical scrolling with a fixed header (above) and footer (below). It also supports horizontal scrolling if the content is wider than the viewport, but it does not support a fixed column on the right or left side.

You can create a new issue for fixed columns if you want, but I don't want this issue to become a dump of all table related issues.

Comment #47

Posted on Sep 7, 2011 by Grumpy Hippo

Released in 2.4

Comment #48

Posted on Sep 8, 2011 by Happy Bear

Where Can I see a working example ? In the Api there is an example for CellTable Under http://google-web-toolkit.googlecode.com/svn/javadoc/latest/com/google/gwt/user/cellview/client/DataGrid.html .

Comment #49

Posted on Sep 8, 2011 by Swift Rhino

The Showcase, DynatableRf and MobileWebApp samples make use of DataGrid.

Comment #50

Posted on Sep 8, 2011 by Massive Cat

The new Showcase sample with DataGrid hasn't been pushed yet, but you can see an example here: http://showcase2.jlabanca-testing.appspot.com/#!CwDataGrid

Comment #51

Posted on Sep 8, 2011 by Happy Bear

Great. Thanks

Status: Fixed

Labels:
Category-UI Milestone-2_4 Type-Feature