David -
What you want to do is sort the data in your data provider. Typically I
do this by storing the date as a number field (milliseconds since epoch)
in the class that I am rendering. This allows numeric sorting on the
date that is rendered in the column. The following snippet creates a
Sort object which can then be set as the sort on your data provider when
the date column is clicked.
var sort:Sort = new Sort();
var dateMillisField:SortField = new SortField("dateMillis",
true, false, true);
sort.fields = [dateMillisField];
Here is a pretty good livedocs entry on sorting data in datagrids
<http://livedocs.adobe.com/flex/2/docs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00000598.html>.
hth
Scott
--
Scott Melby
Founder, Fast Lane Software LLC
http://www.fastlanesw.com
David Pariente wrote:
Hi everyone,
I have a datagrid with a Date column.
I want user to be able to order by that date column, but the Dates in that
column are in DD/MM/YYYY format, and flex doesn't order them propertly.
Does anyone have a solution for that?
Could tell Flex how should the column be ordered, by specifiyng format or
something...?
I actually have no idea how to solve this :(
Thnx a lot
______________________________________________
Enviado desde Correo Yahoo! La bandeja de entrada más inteligente.
--
Scott Melby
Founder, Fast Lane Software LLC
http://www.fastlanesw.com
http://blog.fastlanesw.com