Welcome Guest Search | Active Topics | Members | Log In | Register

Active Records sort and filter Options · View
HaugachakaMan
Posted: Monday, June 18, 2012 3:53:06 AM
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
HaugachakaMan
Posted: Tuesday, June 19, 2012 1:07:19 AM
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
Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

YAFVision Theme Created by Jaben Cargman (Tiny Gecko)
Powered by Yet Another Forum.net version 1.9.1.8 (NET v2.0) - 3/29/2008
Copyright © 2003-2008 Yet Another Forum.net. All rights reserved.
This page was generated in 0.087 seconds.