flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kessler CTR Mark J <mark.kessler....@usmc.mil>
Subject RE: [Non-DoD Source] Grouping arrayCollection
Date Thu, 26 May 2016 10:10:14 GMT
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.

Mime
View raw message