Hi, here's a blog post I made that shows how I'm using the widget.  It may
help if you are still looking for a solution.

http://zenoconsulting.wikidot.com/blog:17

<http://zenoconsulting.wikidot.com/blog:17>Regards,
Davis

On Wed, Nov 4, 2009 at 2:40 AM, shloka <chythanya....@gmail.com> wrote:

>
> Thanks Davis !
>
> Yes,I saw the Bug u have reported.
>
>
> I tried with gwtlib.jar and sample code  given for this in the link
> http://code.google.com/p/gwtlib/
> They use PagingTable and write the comparator code for sorting...
> The approach is same as you have suggested...
>
> So now i have to decide weather to go for PagingScrollTable of
> incubator or PagingTable of gwtlib :)
>
>
> Thanks!!
>
> On Nov 3, 8:36 pm, Davis Ford <davisf...@zenoconsulting.biz> wrote:
> > Sorting does seem to work out of the box.  I ended up building my own
> > comparators.
> >
> > Here's an example of what I did.  I was going to write up a longer blog
> > entry on this -- just haven't had time.
> >
> > Let's say I have a simple object like this for my RowValue:
> >
> > public class Person {
> >    private final String first;
> >    private final String last;
> >    public Person(String first, String last) { first = first; last = last;
> }
> >    public String getFirst() { return first; }
> >    public String getLast() { return last; }
> >
> > }
> >
> > So, I have to define my table model for Person =>
> >
> > private final classs DataSourceTableModel extends
> MutableTableModel<Person>
> > {
> >
> >     private List<Person> list = new ArrayList<Person>();
> >
> >     public void setData(List<Person> list) { this.list = list; }
> >
> >     public void requestRows(final Request request,
> > TableModel.Callback<Person> callback) {
> >             callback.onRowsReady(request, new Response<Person>() {
> >                 @Override
> >                 public Iterator<Person> getRowValues() {
> >                     int col =
> > request.getColumnSortList().getPrimaryColumn();
> >                     boolean ascending =
> > request.getColumnSortList().isPrimaryAscending();
> >
> >                     /* col tells you which column the user clicked and
> > ascending indicates whether to sort up/down */
> >                     /* i wrote my own Sorter class that knows how to sort
> a
> > collection of my own RowValue T here */
> >                     /* return the iterator of your sorted collection */
> >                }};
> >      }
> >
> > }
> >
> > There's a bit more to it, but I found that PagingScrollTable does not
> sort
> > by itself -- never worked for me.  I filed a bug on it.  Thus, I do the
> > sorting myself, and it works well.
> >
> > Hope that helps,
> > Davis
> >
> > On Mon, Nov 2, 2009 at 11:35 PM, shloka <chythanya....@gmail.com> wrote:
> >
> > > Hi All,
> > > I am trying to implement pagination and sorting using the Incubator's
> > > paging scroll table .Could do pagination but Sorting is not happening.
> > > Please pool in some ideas to solve this.Any guidence is highly
> > > appreciated.,,,,
> > > Thanks in Advance.
> >
> > --
> > Zeno Consulting, Inc.
> > home:http://www.zenoconsulting.biz
> > blog:http://zenoconsulting.wikidot.com
> > p: 248.894.4922
> > f: 313.884.2977
> --~--~---------~--~----~------------~-------~--~----~
> You received this message because you are subscribed to the Google Groups
> "Google Web Toolkit" group.
> To post to this group, send email to google-web-toolkit@googlegroups.com
> To unsubscribe from this group, send email to
> google-web-toolkit+unsubscr...@googlegroups.com<google-web-toolkit%2bunsubscr...@googlegroups.com>
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en
> -~----------~----~----~----~------~----~------~--~---
>
>


-- 
Zeno Consulting, Inc.
home: http://www.zenoconsulting.biz
blog: http://zenoconsulting.wikidot.com
p: 248.894.4922
f: 313.884.2977

--

You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=.


Reply via email to