Re: [flexcoders] How to apply a custom sort to ArrayCollection??

2008-11-14 Thread Adrian Williams

Thanks Josh,

   That was exactly what I was looking for...didn't think to access the 
compareFunction property of the sort() function...


Adrian

Josh McDonald wrote:


var s : Sort = new Sort();
s.compareFunction = myComparer;
collection.sort = s;

-Josh

On Fri, Nov 14, 2008 at 9:14 AM, Adrian Williams 
[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote:


All,

I have an ArrayCollection that I'd like to perform an
advanced, custom sort on before it's loaded into a List...the
custom sort is one that i am using for my ADG, using the column's
sortCompareFunction and in a grouping collections
compareFunction.  I can't seem to figure out how to use it as well
for my AC...any ideas?

Here's some code snippets:

ungroupedParticipantsForTileList = new
ArrayCollection;
   
for each (var uPart:Object in

ungroupedParticipantsArray)
{
listInfo = uPart.KitNum +  -  +
uPart.ParticipantName;
   
ungroupedParticipantsForTileList.addItem({kitNum:uPart.KitNum,

label:listInfo});
}   


and the custom sorter:

private function sortNumeric(obj1:Object,
obj2:Object):int

Any help would be appreciated!!


Thanks,
Adrian




--
Therefore, send not to know For whom the bell tolls. It tolls for thee.

Like the cut of my jib? Check out my Flex blog!

:: Josh 'G-Funk' McDonald
:: 0437 221 380 :: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
:: http://flex.joshmcdonald.info/ http://flex.joshmcdonald.info/
:: http://twitter.com/sophistifunk http://twitter.com/sophistifunk
 


[flexcoders] How to apply a custom sort to ArrayCollection??

2008-11-13 Thread Adrian Williams

All,

   I have an ArrayCollection that I'd like to perform an advanced, 
custom sort on before it's loaded into a List...the custom sort is one 
that i am using for my ADG, using the column's sortCompareFunction and 
in a grouping collections compareFunction.  I can't seem to figure out 
how to use it as well for my AC...any ideas?


   Here's some code snippets:

   ungroupedParticipantsForTileList = new ArrayCollection;
  
   for each (var uPart:Object in ungroupedParticipantsArray)

   {
   listInfo = uPart.KitNum +  -  + uPart.ParticipantName;
   
ungroupedParticipantsForTileList.addItem({kitNum:uPart.KitNum, 
label:listInfo});
   }   


and the custom sorter:

   private function sortNumeric(obj1:Object, obj2:Object):int
   
   Any help would be appreciated!!


Thanks,
Adrian


Re: [flexcoders] How to apply a custom sort to ArrayCollection??

2008-11-13 Thread Josh McDonald
var s : Sort = new Sort();
s.compareFunction = myComparer;
collection.sort = s;

-Josh

On Fri, Nov 14, 2008 at 9:14 AM, Adrian Williams
[EMAIL PROTECTED]wrote:

  All,

 I have an ArrayCollection that I'd like to perform an advanced, custom
 sort on before it's loaded into a List...the custom sort is one that i am
 using for my ADG, using the column's sortCompareFunction and in a grouping
 collections compareFunction.  I can't seem to figure out how to use it as
 well for my AC...any ideas?

 Here's some code snippets:

 ungroupedParticipantsForTileList = new ArrayCollection;

 for each (var uPart:Object in ungroupedParticipantsArray)
 {
 listInfo = uPart.KitNum +  -  +
 uPart.ParticipantName;

 ungroupedParticipantsForTileList.addItem({kitNum:uPart.KitNum,
 label:listInfo});
 }

 and the custom sorter:

 private function sortNumeric(obj1:Object, obj2:Object):int

 Any help would be appreciated!!

 Thanks,
 Adrian
  




-- 
Therefore, send not to know For whom the bell tolls. It tolls for thee.

Like the cut of my jib? Check out my Flex blog!

:: Josh 'G-Funk' McDonald
:: 0437 221 380 :: [EMAIL PROTECTED]
:: http://flex.joshmcdonald.info/
:: http://twitter.com/sophistifunk