1
모든 null 값이나 빈 값이 제거되도록하려는 ArrayCollection이 있습니다.Flex를 사용하여 배열 컬렉션에서 Null 값 제거
코드에서 어떤 행이이를 수행 할 수 있습니까?
<mx:Script><![CDATA[
public function cleanArrayCollection(collection:ArrayCollection):ArrayCollection{
var currentArray:Array = null;
var newCollection:ArrayCollection = new ArrayCollection();
for(var i:int = 0; i < collection.length; i++){
currentArray = collection.getItemAt(i);
if(currentArray != null && currentArray.length != 0){
newCollection.addItem(currentArray);
}
}
return newCollection;
}
]]></mx:Script>
편집 : 논리에서 제거 된 중요한 버그