<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:AdvancedDataGrid id="adg1" designViewDataType="tree">
<mx:columns>
<mx:AdvancedDataGridColumn headerText="Icons"
dataField="datafield" sortCompareFunction="sortIcons"/>
</mx:columns>
</mx:AdvancedDataGrid>
<mx:Script>
<![CDATA[
private function sortIcons(obj1:Object, obj2:Object):int{
if (obj1.severity < obj2.severity) return -1;
else if (obj1.severity > obj2.severity) return 1;
return 0; //obj1.severity==obj2.severity
}
]]>
</mx:Script>
</mx:Application>
Hope this helps,
Tibor.
www.tiborballai.com
--- In [email protected], Thomas Silvester <thomas_...@...> wrote:
>
> Code sample please.
> Anitha
>
> --- On Sat, 12/5/09, jer_ela <g...@...> wrote:
>
>
> From: jer_ela <g...@...>
> Subject: [flexcoders] Re: How can I sort ADGColumn with icons as data?
> To: [email protected]
> Date: Saturday, December 5, 2009, 12:02 AM
>
>
> Â
>
>
>
> ADG columns have a sortCompareFunction property. The function will get 2
> objects representing 2 of the datagrid rows. The function decides how to
> compare the object for sorting purposes. So whatever data you have that
> determines which icon to display can be used to determine how the column
> sorts.
>
> --- In flexcod...@yahoogro ups.com, Thomas Silvester <thomas_13s@ ...> wrote:
> >
> > Hi All,
> >  How can I sort icons according to severity in an ADG column? Please if
> > any one know can you give me sample code?
> > thanks,
> > Anitha.
> >
>