You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Martin Grotzke <ma...@javakaffee.de> on 2008/05/10 18:36:23 UTC
T5 setting initial sort order for grid in T5.0.11
Hi,
I'm just upgrading our T5 app from 5.0.10-SNAPSHOT to 5.0.11.
Before we specified the initial sort order with this:
_grid.setSortColumnId("month");
_grid.setSortAscending(false);
With 5.0.11 this is gone. Can anybody tell me how one can specify the
initial sort order (coumn and ascending) in 5.0.11?
Thanx && cheers,
Martin
Re: T5 setting initial sort order for grid in T5.0.11
Posted by grashopper <ax...@freiheit.com>.
Tobias Wehrum wrote:
>
> But that doesn't seem very ideal to me, and I hope there is a better way.
>
I'd still prefer to be able to specify a default sorting in the template,
but here's how I implement an initial sorting on a grid:
if ( grid.getSortModel().getSortContraints().isEmpty() ) {
_grid.getSortModel().updateSort("colName");
}
--
View this message in context: http://www.nabble.com/T5-setting-initial-sort-order-for-grid-in-T5.0.11-tp17165163p18758484.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: T5 setting initial sort order for grid in T5.0.11
Posted by Tobias Wehrum <Le...@dragonlab.de>.
Hi Martin,
with _grid.getSortModel().getColumnSort("month") you can test whether
month is sorted, and which way, and with updateSort("month") you can
cycle through the states.
To sort descending, I call:
--------------------------------------------------------------------------------------------------
if (overviewGrid.getSortModel().getColumnSort("month") ==
ColumnSort.UNSORTED) {
overviewGrid.getSortModel().updateSort("month");
}
if (overviewGrid.getSortModel().getColumnSort("month") ==
ColumnSort.ASCENDING) {
overviewGrid.getSortModel().updateSort("month");
}
--------------------------------------------------------------------------------------------------
But that doesn't seem very ideal to me, and I hope there is a better way.
Greetings,
Tobias
Martin Grotzke schrieb:
> Hi,
>
> I'm just upgrading our T5 app from 5.0.10-SNAPSHOT to 5.0.11.
> Before we specified the initial sort order with this:
>
> _grid.setSortColumnId("month");
> _grid.setSortAscending(false);
>
> With 5.0.11 this is gone. Can anybody tell me how one can specify the
> initial sort order (coumn and ascending) in 5.0.11?
>
> Thanx && cheers,
> Martin
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org