actionscript 3/flex中已过滤的ArrayCollection的长度

Jac*_*eud 3 apache-flex actionscript arraycollection

我需要在List组件中显示具有已过滤的ArrayCollection作为其数据提供者的项目数.我没有看到获得过滤集合长度的方法.谁知道?谢谢.

2DH*_*2DH 5

考虑到代码:

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();
Run Code Online (Sandbox Code Playgroud)

您可以使用ac.length获取过滤数据长度(6)并ac.list.length获得原始未过滤数据长度(10).