Opux
Opux

Reputation: 786

Flex: "warning: unable to bind to property..." for a sortCompareFunction

I'm used to this problem w/variables bound to attributes in Flex tags, but this problem happens in sortCompareFunctions:

<mx:DataGridColumn sortCompareFunction="{Sorts.Manager}">

...

[Bindable]
public final class Sorts {
    public static function Manager(obj0:Object, o0:Object):int {

I thought that [Bindable] tag made a difference for some other members of Sorts, but it hasn't fixed everything. What would?

Upvotes: 0

Views: 231

Answers (1)

JeffryHouser
JeffryHouser

Reputation: 39408

You can only bind properties; or properties defined as get/set methods.

You cannot bind to functions.

Now, you may be able to make a variable of type Function:

[Bindable]
public var sortFunction : Function = Sorts.Manager;

And use that as the source for your sortCompareFunction

<mx:DataGridColumn sortCompareFunction="{sortFunction}">

Upvotes: 1

Related Questions