Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Flex
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Flex
SortCompareFunction is not working in Flex
Booma Devi
Ranch Hand
Posts: 61
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi,
I am using flex version 4.5 and trying to
test
the sortCompareFunction.. But its not working.. Can any one please help me..?
Below is my mxml code:
<?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"> <fx:Script> <![CDATA[ import mx.utils.ObjectUtil; import mx.events.FlexEvent; import spark.collections.Sort; import spark.collections.SortField; import spark.globalization.SortingCollator; private var collator:SortingCollator = new SortingCollator(); private function sortCompareFunction(obj1:Object, obj2:Object, gc:GridColumn):int { collator.ignoreCase = true; return collator.compare(obj1[gc.dataField], obj2[gc.dataField]); } ]]> </fx:Script> <fx:Declarations> <s:ArrayList id="PersonList"> <fx:Object name="Dan Florio" typeofperson="polyGeek" /> <fx:Object name="David Ortinau" typeofperson="davidortinau" /> <fx:Object name="Simeon Bateman" typeofperson="simBateman" /> </s:ArrayList> </fx:Declarations> <s:DataGrid id="dg" x="294" y="152" width="30%" height="30%" alternatingRowColors="[ #eeeeFF, #eeFFee, #FFeeee ]" dataProvider="{PersonList}" editable="true" requestedRowCount="-40"> <s:columns> <s:ArrayList> <!-- dataField has beent taken from the object's properties --> <s:GridColumn dataField="name" headerText="NAME" /> <s:GridColumn dataField="typeofperson" headerText="TYPE OF PERSON" sortCompareFunction="sortCompareFunction"/> </s:ArrayList> </s:columns> </s:DataGrid> </s:Application>
If you look closely at this tiny ad, you will see five bicycles and a naked woman:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Picture upload from flex RIA to MySql using java
DataGrid With RemoteObject
issue to RemoteObject based on LCDS in my flex app demo
Flex and Java cannot add anything to list
Reloading custom mxml component
More...