5

I have noticed after some research that smartGWT don't support pagination in the ListGrid but only dynamic scroll. But if I really need pagination, how can I achieve this?

Let's say I want something like this with the "next" and "previous" buttons:

http://gwt.google.com/samples/Showcase/Showcase.html#!CwCellTable

PS: This example is in GWT, what I want is something similar but in smartGWT

Adel Boutros
  • 10,205
  • 7
  • 55
  • 89

2 Answers2

4

I'm sorry that there is no Paging component in SmartGWT. But some nice guy has written a component called GridPager, which could meet your requirement, I think.

GridPager should works with ListGrid.

You can find the information of the component by googling.

There is also a discussion about the paging function of SmartGWT, I think it helps. The url is http://forums.smartclient.com/showthread.php?t=3103

GridPager is also mentioned in the discussion.

BlueMice
  • 333
  • 4
  • 15
0

If you want something "similar", not precisely the same, why don't you...

  • Implement dynamic scroll
  • Extend ListGrid and add two buttons wherever you want
  • Have the buttons scroll up/down as if those are the previous/next "pages"?
Marcelo
  • 4,580
  • 7
  • 29
  • 46
  • Pagination is the exact opposite of dynamic scroll because once you scroll down, the previous results remains there and if for example I want to select all lines of Page 2, this wouldn't work because all the previous lines (from Page 1) would be selected too ... – Adel Boutros Mar 05 '12 at 13:25
  • @AdelBoutros, it's just a matter of overriding the `selectAll` (or creating a `selectPage()`) behavior and defining the number of "lines" a "page" has... keeping the contents of previous pages in the browser shouldn't present a problem, unless your user spans hundreds of pages (and even so, SmartGWT probably has something to clear older results). – Marcelo Mar 05 '12 at 13:28
  • Your proposed solution will require complexe operations. It would far easier for me to make a datasource per Page and let the previous/next buttons swap the currently loaded DataSource. – Adel Boutros Mar 05 '12 at 14:02
  • But I was wondering is there a way to ask the datasource to only fetch for example 50 lines and then on each click of previous/next button tell it to fetch the next or previous 50 lines? – Adel Boutros Mar 05 '12 at 14:03