I've not experienced it yet my self but the problem is probably the dates.
Flex does string comparison on the dates not object comparison. (even if
they were dates which they're probably strings by the time they get into
your application.  I haven't verified the accuracy of said post but at a
glance
http://blog.flexexamples.com/2007/08/12/sorting-date-columns-in-a-datagrid/looks
like it has what you need.

On Thu, Aug 20, 2009 at 9:30 PM, lanekelly5 <lkel...@gmail.com> wrote:

> I'm trying to load a few elements of an RSS feed into a DataGrid, and I'm
> having trouble with the code to pre-sort the data before the grid gets it.
>  Here's a snippet of the code:
>
> private function requestRSS(e:FlexEvent):void
>                        {
>                                initVars();
>                                showBusyCursor();
>                                rssService.url = rssUrl;
>                                rssService.resultFormat = "e4x";
>                                rssService.useProxy = false;
>
>  rssService.addEventListener(ResultEvent.RESULT, resultHandler);
>
>  rssService.addEventListener(FaultEvent.FAULT, faultHandler);
>                                rssService.send();
>                        }
>
> private function resultHandler(e:ResultEvent):void
>                        {
>                                listHeadlines.dataProvider =
> e.target.lastResult.channel.item;
>                        }
>
> In the mxml:
> <mx:DataGrid id="listHeadlines" width="433" height="113"
> click="showDetails(event)">
>    <mx:columns>
>        <mx:DataGridColumn dataField="pubDate" sortDescending="true"/>
>        <mx:DataGridColumn dataField="title"/>
>    </mx:columns>
> </mx:DataGrid>
>
> At this point my data in e.target.lastResult.channel.item is not always
> sorted properly.  I'd like to sort it by pubDate descending before filling
> out the DataGrid.  Any guidance on this?
>
>
>
> ------------------------------------
>
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Alternative FAQ location:
> https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
> Search Archives:
> http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups
> Links
>
>
>
>

Reply via email to