Friday, March 25, 2011

Re: Controlling multiple columns sort order in GWT 2.2 CellTable

Hmm... One idea came to me... Would you just accomplish this by
providing a comparator for the column that drives the 1st order sort
that has custom code to sort the rest of the data at that point? I
guess that should work, right?

-yaakov.

On Fri, Mar 25, 2011 at 12:06 PM, Yaakov <yaakov.chaikin@gmail.com> wrote:
> Hi,
>
> At this point, I figured out how to create a multiple column sort. I
> create 1 ListHandler and hadd that to the CellTable with the
> addColumnSortHandler method. I set each column I want to be sorted
> with setSortable(true) and then set multiple Comparators for each of
> those columns using the ListHandler.setComparator method.
>
> At the very end, I do this:
> cellTable.getColumnSortList().push(column3);
> cellTable.getColumnSortList().push(column2);
> cellTable.getColumnSortList().push(column1);
>
> This way column1 becomes the primary column to sort by, following by
> sorting on column2, and then column3.
>
> The question is this... How is the column sorting order affected when
> I click on column2, for example? Obviously, if I do that, column2
> becomes the primary sort column, but what is the secondary? column1?
>
> What if I want to make it that when the user clicks on column2, the
> column sorting order should be column2, column3, column1? How do I
> accomplish that at the same time keeping a regular column sorting
> order when the user click on column1 (i.e., column1, column2,
> column3)?
>
> Any help would be much appreciated!
>
> Thanks,
> Yaakov.

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment