Yep, looks like we only pass you the values,
not the object for the rows themselves. Guess you’ll need to set sortOnHeaderRelease
to false and instead call sortItems yourself with a custom compareFunc.
Matt
From: Robin Hilliard
[mailto:[EMAIL PROTECTED]
Sent: Monday, February 14, 2005
9:26 PM
To: [email protected]
Subject: [flexcoders]
DataGridColumn sortCompareFunction arguments dual personality
Hello,
Check the end of the flex 1.5 release notes:
http://www.macromedia.com/support/documentation/en/flex/1_5/
releasenotes.html
You'll see a code example for the callback
function set as the
sortCompareFunction of a data grid column.
In this example the a and b
arguments passed to the callback are used
sometimes as row objects, and
sometimes as string values of the cell in the
column being sorted. My
experimentation shows that the latter is thecase,
which is a pain if
your sorting algorithm involves multiple columns
of the datagrid. An
obvious example of where you would want to do this
is when someone
clicks on a flight price column you might want to
order by price and
within price by departure time.
Can anyone shed any light on this? I can
feel an ugly hack coming on.
Robin
|