views:

19

answers:

1

I would like to provide my own sortItemRenderer within an AdvancedDataGrid like so:

<mx:AdvancedDataGrid sortItemRenderer="MyRenderer"></mx:AdvancedDataGrid> 

MyRenderer is a class that I wrote, but Flex doesn't see it and gives "defintion not found" error, because it is not within the mx namespace. What is a clean way to make this to work?

+1  A: 

You have to provide the fully qualified name for your renderer : if you class is in package myPackage.MyRenderer then sortItemrenderer="myPackage.MyRenderer"

Patrick
Thanks! Is there any way not to write out the package path and still use the class?
Fortress
@Fortress In ActionScript, if your itemRenderer class is in the same package structure as the class that contains your AdvancedDataGrid, then you won't have to fully qualify the class name. I never tried that in MXML, though. In AS3 you have to define the classFactory something like this: adg.sortItemRenderer = new ClassFactory(MyRenderer);
www.Flextras.com
It makes sense to define the classFactory through AS3.
Fortress