Rank: Newbie Coder Groups: Member
Joined: 5/31/2012 Posts: 7 Points: 18 Location: Portugal - Lisbon
|
Hello
I'm trying to filter and sort my records on the request to the SQL Table. I have done this in other cases but not together. Note that since I have to use and descending order on the sort I can't find a way to use the "{Sort:['lastUpdatedDate']}" on the filtering option (code bellow).
Sort I'm doing var acData:ArrayCollection; var sortOrder:Object = new Object(); sortOrder.Sort = ["lastUpdatedDate:DESC"]; acData = ActiveRecords.table.findAll(sortOrder);
Filtering: acData = ActiveRecords.table.findByCategoryAndSystem(category, system);
Is it possible to join these two type of processes?
Thanks in advance, best regards João Pedro de Almeida
|
Rank: Newbie Coder Groups: Member
Joined: 5/31/2012 Posts: 7 Points: 18 Location: Portugal - Lisbon
|
I got to solve this yesterday, so if any one has the same need here is how I did it.
var acData:ArrayCollection; var sortOrder:Object = new Object(); sortOrder.Sort = ["lastUpdatedDate:DESC"]; acData = ActiveRecords.Sga_dashboard_news.findByCategoryAndSystem(category, system, sortOrder); acData.addEventListener(DynamicLoadEvent.LOADED, GetNews);
Cheers João Pedro de Almeida
|