PDA

View Full Version : Sorting ArrayCollection sub-elements


crapaganda
04-25-2009, 08:55 PM
Hi there,

I'm having an issue with the SortField class.

I'm building a facebook application & I want to sort ArrayCollection by and element of an element. I want to sort it by 'time', which is a sub-element of 'status'.

my array looks like this:
[user.name,user.pic_square,user.status.message,user .status.time]

I'm trying to sort it like this:
idSortField.name = "status.time";
idSortField.numeric = true;

I thought the previous method would have worked because if i sort by 'name' it works;
idSortField.name = "name";
idSortField.numeric = false;


Has anyone come across anything like this before?

drkstr
04-26-2009, 05:40 AM
Use the Sort.compareFunction property when sorting Objects.


Best Regards,
~Aaron