RE: [Flashcoders] Datagrid sorting

2007-03-16 Thread Merrill, Jason
>>[mailto:[EMAIL PROTECTED] On Behalf >>Of Bojil Vassilev >>Sent: Thursday, March 15, 2007 4:50 PM >>To: flashcoders@chattyfig.figleaf.com >>Subject: Re: [Flashcoders] Datagrid sorting >> >>You should add a listener to the DataGrid and then sort the >

Re: [Flashcoders] Datagrid sorting

2007-03-15 Thread Bojil Vassilev
You should add a listener to the DataGrid and then sort the dataprovider. Here is a quick example, also sorting both ways Asc<>Desc (keeping track if a column is sorted one way and sorting it the other way next time) myDataGrid.addColumn("Product"); myDataGrid.addColumn("Quality"); myDataGrid.

RE: [Flashcoders] Datagrid sorting

2007-03-15 Thread Derek Lords
Can your DataProvider be xml? I'm not sure the Array sort methods do what you want, they might, but they're probably less efficient than an xml transformation anyway. then you might try sorting the dataSource itself beforehand using in an xsl template? When you want to reverse the sort, just

RE: [Flashcoders] Datagrid sorting

2007-03-15 Thread Pete Miller
Is dataProvider.sortOn a proper method? Do you want dataProvider.sortItemsBy instead? P. >> -Original Message- >> From: [EMAIL PROTECTED] [mailto:flashcoders- >> [EMAIL PROTECTED] On Behalf Of Merrill, Jason >> Sent: Thursday, March 15, 2007 1:16 PM >> To: flashcoders@chattyfig.figleaf.c