Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要显示具有过滤的 ArrayCollection 作为其数据提供者的 List 组件中的项目数。我看不到获得过滤集合长度的方法。有人知道吗?谢谢。
考虑代码:
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();
您用于ac.length获取过滤后的数据长度 (6) 并ac.list.length获取原始的、未过滤的数据长度 (10)。
ac.length
ac.list.length