Unless the itemRenderer displays just a string or a number, the default sort logic may have problems. Look at the DataGrid's sortCompareFunction.
-TH --- In [email protected], "sailorsea21" <sailorse...@...> wrote: > > Hi everyone, I'm having a problem with sorting columns in a datagrid when using itemRenderer. > > Without the itemRenderer, everything works fine but when I use an itemRenderer, the column with the itemRenderer doesn't sort, it simply rotates the rows of that column.... > > dgColumn.itemRenderer = new ClassFactory(Smiles); > > Here's my itemRenderer file Smiles.mxml: > > <?xml version="1.0" encoding="utf-8"?> > <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="setSmileImage()"> > > <mx:Script> > <![CDATA[ > > [Bindable] > private var smileImage:String; > > private function setSmileImage():void > { > if(data.amount < 50) > { > smileImage= 'smile001.png'; > } > else if(data.amount >= 50) > { > smileImage= 'smile002.png'; > } > } > > ]]> > </mx:Script> > > <mx:Image id="image" verticalCenter="0" horizontalCenter="0" source="{smileImage}"/> > > </mx:Canvas> >

