You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by Kessler CTR Mark J <ma...@usmc.mil> on 2016/05/26 10:10:14 UTC

RE: [Non-DoD Source] Grouping arrayCollection

Do you mean using filterFunction[1] to only show one set/group of the rows at a time?


myAC.filterFunction = myFilterFunction;


public function myFilterFunction(item:Object):Boolean
{
    if (String(item.name) == "A")
    {
        //show
        return true;
    }

    //hide
    return false;
}




[1] http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/collections/ListCollectionView.html#filterFunction


-Mark


-----Original Message-----
From: jfb [mailto:j.balladares@verizon.net]
Sent: Wednesday, May 25, 2016 7:52 AM
To: users@flex.apache.org
Subject: [Non-DoD Source] Grouping arrayCollection

Hi All,
I have this array collection:
public var myAC:ArrayCollection = new ArrayCollection([
                                        {name:"A", code:10, fy2014:50, fy2015:100},
                                        {name:"A", code:10, fy2014:150, fy2015:250},
                                        {name:"A", code:20, fy2014:200, fy2015:350},
                                        {name:"A", code:20, fy2014:300, fy2015:450},
                                        {name:"B", code:10, fy2014:100, fy2015:150},
                                        {name:"B", code:10, fy2014:200, fy2015:250},
                                        {name:"B", code:20, fy2014:300, fy2015:350},
                                        {name:"B", code:20, fy2014:400, fy2015:450},
                                ]);
How can I group the ac with totals? like:
                                name, code, t2014, t2015
                                A, 10, 200, 350
                                A, 20, 500, 800
                                B, 10, 300, 400
                                B, 20, 700, 800
Thanks!




--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Grouping-arrayCollection-tp12768.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

RE: [Non-DoD Source] Grouping arrayCollection

Posted by jfb <j....@verizon.net>.
Thanks Mark for your reply and help.
The filter only group the data, I did create another array an stored the
summary of the filter result.
Best,



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Grouping-arrayCollection-tp12768p12796.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.