This content has been marked as final. Show 6 replies
You have an ArrayCollection of what? What are the elements in the collection? What dataType? What structure?
when I debug my array collection event.result.object through  or so then in each object there is news_id, fkstate_id all my database fields.
Does this help you
Basically what I need to know is how to access a arrayCollection I'm reading the flex documentation but I'm quite new to this so its not making a lot of sense.
You can use a for loop like this :
for (var i:int = 0; i < arrayCoolection.length ; i++)
var item:Object = arrayCollection ;
or use a IViewCursor.
How to navigate an array collection using IViewCusror is explained here
For the filterFunction you will receive each item in the ArrayCollection. There you can just say item.property_name to access the property value.
var sFKStateId:String = myArrayCollection.getItemAt(iIndex).fkstate_id;
will return that property's value for the first item.
So I just did a loop in my filterFunction and worked great thanks to all those that helped me
private function statesFilter(_getStates:Object):Boolean
var currentCountry:Object = countryList.selectedItem as Object;
for (var i:int = 0; i < _getNews.length ; i++)
var item:Object = _getNews;
if(currentCountry.country_id == _getStates.fkcountry_id && item.getItemAt(i).fkstate_id == _getStates.state_id)