I had seen sortCompareFunction, but I hadn't seen labelFunction.  Much
nicer than using an ItemRenderer.  It still left me with the
uncomfortable situation where I would have to write a lot of display
and sort functions to get the various behavior I want.

Then I ran across your blog posting about extending DataGridColumn.
That's a brilliant idea.  I created a custom DataGridColumn, defined a
"complexDataField" property, and set the labelFunction and
sortCompareFunction to functions in my custom class that do their
thing based off of the complexDataField property.  The result is that
I can now specify complex properties like "role.application.code" in
my MXML code, and the custom DataGridColumn uses that to walk the
object graph to get what I need.  

The MXML got a lot simpler, and I only needed one labelFunction and
one sortCompareFunction that genericly works on any object.

Sound like a reasonable approach?

Steve
--- In flexcoders@yahoogroups.com, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> Typically, one uses labelFunction to pull role.application.code and
> display it, and provides a custom sortCompareFunction that pulls the
> same and sorts it.
> 
>  
> 


Reply via email to