Davis, thanks for the post ...
In your example Are you using the pagination also?
How do you maintain sorted data between the pages??
I have implemented sorting almost like what you have done....
but i am facing problem in maintaining the sorted data with the
pagination.
say i have 10 rows and i make it 5 rows per page.Hence i get 2 pages
now the first page is sorted and fine .when i click the button to go
to next page the control goes to the below  function in the
DataSourceTableModel
public void requestRows(final Request request,
      final Callback<Student> callback) {
// here we have method to create the new data.. how do we stop this?
since i have 5 more rows of old sorted data  yet to be rendered
 or
if we have hard coded array list  data it will again fetch the data as
per page size ie first 5 data  but i need data from 6 to 10 .
}

pls share u r thoughts on this.....

Thanks
Chythanya
On Nov 16, 7:27 am, Davis Ford <[email protected]> wrote:
> 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 <[email protected]> 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 <[email protected]> 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 <[email protected]> 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 [email protected]
> > To unsubscribe from this group, send email to
> > [email protected]<google-web-toolkit%2bunsubs­[email protected]>
> > 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- Hide quoted text -
>
> - Show quoted text -

--

You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
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=.


Reply via email to