The length of the filtered ArrayCollection array in actionscript 3 / flex

I need to display the number of elements in a List component that has a filtered ArrayCollection as a data provider. I see no way to get the filtered length of the collection. Somebody knows? Thank.

+3
source share
1 answer

Given the code:

var ac:ArrayCollection = new ArrayCollection([0,1,2,3,4,5,6,7,8,9]);
ac.filterFunction =
    function(item:*):Boolean{
        return item > 3;
    };
ac.refresh();

You use ac.lengthto obtain the length of the filtered data (6) and ac.list.lengthto obtain the raw, unfiltered data length (10).

+5
source

Source: https://habr.com/ru/post/1775852/


All Articles