On Dec 4, 8:13 pm, Suri <[EMAIL PROTECTED]> wrote:
> Hi all,
> I'm trying to figure out how you can sort locally using the
> PagingScroll table. Not sure what the syntax is so any help is
> appreciated. Thanks
>
> Suri

I've just started using the PagingScrollTable myself, but I think I
can point you in the right direction.

There is a TableModel that you need to define in order to get the
PagingScrollTable to work at all. This class defines one method that
you need to implement:

        public void requestRows(Request request, Callback<T>
callback) ;

You probably already know that you can interrogate the Request object
here to determine the start row and number of rows that you need to
obtain data for.

    int start = request.getStartRow();
    int max = request.getNumRows();


You can also interrogate it for some other things, one of them being a
ColumnSortList object:


            ColumnSortList csList = request.getColumnSortList();

>From this object you can get some other things:

            int column = csList.getPrimaryColumn();
            ColumnSortInfo info = csList.getPrimaryColumnSortInfo()
            boolean isAscending = csList.isPrimaryAscending();

Now you said you wanted to sort on the client side, so I assume you've
got a Collection of objects and some Comparators.  I would guess that
You could use the above to determine which Comparator to use.    Then
you would sort the collection and and return the range of items from
start to start+max.

I haven't done this myself yet, so read my advice with a skeptical
eye.




--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to