You could sort on multiple columns as well with DataGrid.sortItems():
http://livedocs.macromedia.com/flex/15/asdocs_en/mx/controls/listclasses/DataProvider.html#sortItems
 
There's an exemple here for flash RecordSets but the logic is the same:
http://livedocs.macromedia.com/flashremoting/mx/Using_Flash_Remoting_MX/asDict43.htm
 
 
Philippe Maegerman


From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Devis
Sent: mardi 12 juillet 2005 16:27
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] DataGrid auto Sort

Very good, your code work fine.
Regards

Devis

Nick Watson ha scritto:

> Here you go, this also includes the direction arrow as well
>
> <mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml"
> backgroundColor="#FFFFFF">
>
>     <mx:Script>
>
>     <![CDATA[
>
>         function showArrow(){
>
>                         myGrid.sortItemsBy("value","asc");
>
>             myGrid.sortIndex = 1;
>
>             myGrid.sortDirection = "ASC";
>
>             myGrid.placeSortArrow();
>
>          }
>
>     ]]>
>
>     </mx:Script>
>
>     <mx:Panel title="DataGrid Panel" marginTop="10">
>
>         <mx:VBox initialize="showArrow()">
>
>             <mx:DataGrid id="myGrid" showDataTips="true" width="350"
> height="150">
>
>                 <mx:dataProvider>
>
>                     <mx:Array id="arr">
>
>                         <mx:Object name=" a" Value="Test_1" />
>
>                         <mx:Object name=" b" Value="Test_2" />
>
>                                                 <mx:Object name=" a"
> Value="Test_3" />
>
>                                                 <mx:Object name=" a"
> Value="Test_4" />
>
>                                                 <mx:Object name=" b"
> Value="Test_5" />
>
>                     </mx:Array>
>
>                 </mx:dataProvider>
>
>             </mx:DataGrid>
>
>         </mx:VBox>
>
>     </mx:Panel>
>
> </mx:Application>
>
>
> Regards
>
> Nick
>
> *From:* flexcoders@yahoogroups.com
> [mailto:[EMAIL PROTECTED] On Behalf Of* Devis
> *Sent:* 12 July 2005 14:51
> *To:* flexcoders@yahoogroups.com
> *Subject:* [flexcoders] DataGrid auto Sort
>
> Sorry for my stupid question
>
> i have a simple dataGrid i wish when my application  start, that the
> DataGrid are sorted with column number 3?
> It's possibile please
> Devis
>
>
>
>
>>
>
>
>
> --
> Flexcoders Mailing List
> FAQ: _http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt_
> Search Archives:
> _http://www.mail-archive.com/flexcoders%40yahoogroups.com_
>
> SPONSORED LINKS
>
> _Computer software testing_
> <http://groups.yahoo.com/gads?t=ms&k=Computer+software+testing&w1=Computer+software+testing&w2=Macromedia+flex&w3=Development&w4=Software+developer&c=4&s=93&.sig=kh2CguJwmatU5oBXjFo9Rg>
>       _Macromedia flex_
> <http://groups.yahoo.com/gads?t=ms&k=Macromedia+flex&w1=Computer+software+testing&w2=Macromedia+flex&w3=Development&w4=Software+developer&c=4&s=93&.sig=dAUcEV7do91-wrRtVS641g>
>         _Development_
> <http://groups.yahoo.com/gads?t=ms&k=Development&w1=Computer+software+testing&w2=Macromedia+flex&w3=Development&w4=Software+developer&c=4&s=93&.sig=AlxNUQBOI7Io7S7nhmxV0Q>
>   
> _Software developer_
> <http://groups.yahoo.com/gads?t=ms&k=Software+developer&w1=Computer+software+testing&w2=Macromedia+flex&w3=Development&w4=Software+developer&c=4&s=93&.sig=QWIit8JayomoIHLVkV3FDg>
>                    
>
> YAHOO! GROUPS LINKS
>
> §        Visit your group "_flexcoders_
> <http://groups.yahoo.com/group/flexcoders>" on the web.

> §        To unsubscribe from this group, send an email to:
>  [EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>

> §        Your use of Yahoo! Groups is subject to the _Yahoo! Terms of
> Service_ <http://docs.yahoo.com/info/terms/>.
>
>
>
>
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
>
>
> ------------------------------------------------------------------------
> YAHOO! GROUPS LINKS
>
>     *  Visit your group "flexcoders
>       <http://groups.yahoo.com/group/flexcoders>" on the web.
>       
>     *  To unsubscribe from this group, send an email to:
>        [EMAIL PROTECTED]
>       <mailto:[EMAIL PROTECTED]>
>       
>     *  Your use of Yahoo! Groups is subject to the Yahoo! Terms of
>       Service <http://docs.yahoo.com/info/terms/>.
>
>
> ------------------------------------------------------------------------
>



--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




YAHOO! GROUPS LINKS




------------------------------------------------------------------
**STATEMENT OF CONFIDENTIALITY**

This e-mail and any attached files are confidential and intended solely for the use of the individual to whom it is addressed. If you have received this email in error please send it back to the person that sent it to you. Any views or opinions presented are solely those of author and do not necessarily represent those the Emakina Company. Unauthorized publication, use, dissemination, forwarding, printing or copying of this email and its associated attachments is strictly prohibited.

We also inform you that we have checked that this message does not contain any virus but we decline any responsability in case of any damage caused by an a non detected virus.
------------------------------------------------------------------

Reply via email to