I have a dataGrid of about 20 columns, whose dataProvider is an
XMLListCollection:

<mx:XMLListCollection id="delays_xml"
source="{getadvisordelays.result.*}" filterFunction="filterData"/>

where getadvisordelays is an HTTPService call to a jsp, returning
results in an e4x format:
<mx:HTTPService id="getadvisordelays" url=""
method="GET" showBusyCursor="true" resultFormat="e4x">

I'm wanting the ability for the user to sort columns when they click
on the column header. Do I apply the sort as part of the
XMLListCollection via the "sort" attrib, or via a
sortCompareFunction on the individual dataGridColumns?

I made an initial try of adding a custom compare function as part of
the dataGridColumn, but I get an error of "expecting 3 args, but
could 2" when I click on the column header:

<mx:DataGridColumn id="col1" resizable="false" textAlign="center"
fontWeight="bold" headerText="STA" width="{dgDelays.width/22}"
headerWordWrap="on" dataField="acfrmsta"
labelFunction="labelFunction" sortCompareFunction="sortAlpha"/>

my sortAlpha function prototype is:
      public function sortAlpha
(a:Object,b:Object,index:Number):Number

I couldn't see why it was passing just two args, so I started
investigating sorting on the XMLListCollection instead.

any suggestions?









--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to