GWT 2.1 Widgets for presenting data without paging

I am trying to create a table with a large dataset and would like to avoid paging. (I would like to do something similar to the Yahoo Mail grid, which retrieves the data after drawing the grid. I think the first 100 letters are initially retrieved, and then the mail is retrieved only after the user scrolls)

The example data widget I saw includes paging. Can I do what I want?

edit: You can also call it an infinite scroll table.

+6
gwt tabular
source share
4 answers

Dean already mentioned Ext GWT, but I would like to suggest an implementation of SmartGWT .

+1
source share

Here is an example of this in the GWT Showcase

/** * A scrolling pager that automatically increases the range every time the * scroll bar reaches the bottom. */ public class ShowMorePagerPanel extends AbstractPager { /** * The default increment size. */ private static final int DEFAULT_INCREMENT = 20; /** * The increment size. */ private int incrementSize = DEFAULT_INCREMENT; /** * The last scroll position. */ private int lastScrollPos = 0; /** * The scrollable panel. */ private final ScrollPanel scrollable = new ScrollPanel(); /** * Construct a new {@link ShowMorePagerPanel}. */ public ShowMorePagerPanel() { initWidget(scrollable); // Handle scroll events. scrollable.addScrollHandler(new ScrollHandler() { public void onScroll(ScrollEvent event) { // If scrolling up, ignore the event. int oldScrollPos = lastScrollPos; lastScrollPos = scrollable.getScrollPosition(); if (oldScrollPos >= lastScrollPos) { return; } HasRows display = getDisplay(); if (display == null) { return; } int maxScrollTop = scrollable.getWidget().getOffsetHeight() - scrollable.getOffsetHeight(); if (lastScrollPos >= maxScrollTop) { // We are near the end, so increase the page size. int newPageSize = Math.min( display.getVisibleRange().getLength() + incrementSize, display.getRowCount()); display.setVisibleRange(0, newPageSize); } } }); } /** * Get the number of rows by which the range is increased when the scrollbar * reaches the bottom. * * @return the increment size */ public int getIncrementSize() { return incrementSize; } @Override public void setDisplay(HasRows display) { assert display instanceof Widget : "display must extend Widget"; scrollable.setWidget((Widget) display); super.setDisplay(display); } /** * Set the number of rows by which the range is increased when the scrollbar * reaches the bottom. * * @param incrementSize the incremental number of rows */ public void setIncrementSize(int incrementSize) { this.incrementSize = incrementSize; } @Override protected void onRangeOrRowCountChanged() { } } 
+4
source share

Yes it is possible. There used to be an example of what is called DynaGrid, but this link is now dead. I could not find it anywhere else (note: this is not the same as DynaGrid at SourceForge ). You may be able to contact the author, Rainier Zwitserlot, to inquire about receiving a copy of his DynaGrid. You can also find the GWT Group , and if you don't find anything, write where someone knows where to find it.

0
source share

Ext Gwt (AKA GXT) has a Live Grid implementation that supports this functionality (see http://www.sencha.com/examples/explorer.html#livegrid ). The code is the GPL, although you can buy a license for use in commercial applications.

0
source share

All Articles