Off the top of my head... using the Sort class on your dataprovider will
do what you are looking for.  Even sets the sort arrow for you.
 
Using placeSortArrow() gets a little hairy, I've been down that road
before.
 

        -----Original Message-----
        From: [email protected]
[mailto:[EMAIL PROTECTED] On Behalf Of Ian M. Jones
        Sent: Tuesday, May 22, 2007 11:31 AM
        To: [email protected]
        Subject: Re: [flexcoders] Re: Datagrid auto sorting. Has anyone
done this?
        
        

        As a total newbie, having just seen this in the docs, I may be
totally
        wrong, but have you looked at the DataGrid's placeSortArrow()
method?
        
        I'm not sure how you use it, but it looks promising.
        
        Regards,
        -- 
        Ian M. Jones
        ________________________________________
        IMiJ Software
        http://www.imijsoft.com <http://www.imijsoft.com> 
        http://www.ianmjones.net <http://www.ianmjones.net>  (blog)
        
        On Tue, May 22, 2007 14:06, polestar11 wrote:
        > Hi there
        >
        > I tried exactly that in various different ways, but wasnt able
to get
        > it to work.
        >
        > I have an array, which I convert to an array collection, on
which I
        > sort and refresh, after which I set as a dataProvider for my
DataGrid.
        >
        > Still no sort arrow is shown.
        >
        > I then tried extending the DataGrid class, but that opened up
another
        > can of worms
        >
        > Help, anyone??
        > Tracy
        >
        >
        > --- In [email protected]
<mailto:flexcoders%40yahoogroups.com> , "Manish Jethani"
        > <[EMAIL PROTECTED]> wrote:
        >>
        >> On 4/28/07, Mark Piller <[EMAIL PROTECTED]> wrote:
        >> > Do you know how to configure a datagrid to automatically
sort in a
        >> > particular column before the data is rendered?
        >>
        >> Basically you just set the sort on the collection, and the
DataGrid
        >> will appropriately display a sort arrow on the header. So
it's the
        >> collection you need to sort.
        >>
        >> You can see an example of how to sort a collection here:
        >>
        >>
http://www.adobe.com/livedocs/flex/2/langref/mx/collections/Sort.html
<http://www.adobe.com/livedocs/flex/2/langref/mx/collections/Sort.html> 
        >>
        >
        >
        >
        >
        > --
        > Flexcoders Mailing List
        > FAQ:
http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
<http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt> 
        > Search Archives:
http://www.mail-archive.com/flexcoders%40yahoogroups.com
<http://www.mail-archive.com/flexcoders%40yahoogroups.com> 
        > Yahoo! Groups Links
        >
        >
        >
        >
        >
        
        

         

Reply via email to