I'm sorry. I obviously didn't explain myself very well. I really need a self contained application that will run without modification and shows the problem. This way I can copy/paste or import into FB and play with it until I get it to work (Or give up).
--- In flexcoders@yahoogroups.com, "ZIONIST" <stinas...@...> wrote: > > okay this is exactly what am doing. i have an arraycollection(dataAr) that is > populated by data from a database. i have a multiple filter function that i > use to filter the arraycollection(dataAr) and each time its filtered i > refresh it. i then assign the filtered arraycollection(dataAr) to a new > arraycollection(copydataAr), which i use as the dataprovider for the > tilelist. here is a snippet of the code. > > [Bindable] > private var dataAr:ArrayCollection = new ArrayCollection; > public function displayResult(event:ResultEvent):void{ > dataAr = new ArrayCollection((event.result as > ArrayCollection).source); > } > > private function filterGrid():void{ > dataAr.filterFunction=myFilterFunction; > dataAr.refresh(); > } > > private function myFilterFunction(item:Object): Boolean{ > return(item.city == selectedCity || selectedCity == "All") && > (item.location == selectedLocation || selectedLocation == > "All") && > (item.bedrooms >= selectedbdrm || selectedbdrm == "-- Choose > One --") && > (item.bathrooms >= selectedbathrm || selectedbathrm == "-- > Choose One --") && > (item.category == category.selectedValue)&& > (!garageSelected || item.garages)&& > (!tileflrSelected || item.tile_floor)&& > (!hardwoodflrSelected || item.hardwood_floor)&& > (!laminateflrSelected || item.laminate_floor)&& > (!balconySelected || item.balcony)&& > (!yardSelected || item.backyard)&& > (!closetSelected || item.closets)&& > (!poolSelected || item.pool); > > } > > private var selectedCity : String = "All"; > private var selectedLocation : String = "All"; > private var selectedValue: Boolean; > private var selectedbdrm : String = "-- Choose One --"; > private var selectedbathrm : String = "-- Choose One --"; > private var poolSelected: Boolean = false; > private var yardSelected: Boolean = false; > private var closetSelected: Boolean = false; > private var garageSelected: Boolean = false; > private var tileflrSelected: Boolean = false; > private var hardwoodflrSelected: Boolean = false; > private var laminateflrSelected: Boolean = false; > private var balconySelected: Boolean = false; > > private function cityChangeHandler(event:Event):void{ > if( city_cb.selectedItem != null ) > selectedCity = city_cb.selectedLabel; > filterGrid(); > currentState = ''; > } > > private function locationChangeHandler(event:Event):void{ > if( lct_cb.selectedItem != null ) > selectedLocation = lct_cb.selectedLabel; > filterGrid(); > currentState = ''; > } > > private function bedroomChangeHandler(event:Event):void{ > if( room_cb.selectedItem != null ) > selectedbdrm = room_cb.selectedLabel; > filterGrid(); > currentState = ''; > } > > private function bathroomChangeHandler(event:Event):void{ > if( bath_cb.selectedItem != null ) > selectedbathrm = bath_cb.selectedLabel; > filterGrid(); > currentState = ''; > } > > private function categoryChangeHandler(event:Event):void{ > if(category.selectedValue != null) > selectedValue = category.selectedValue; > filterGrid(); > currentState = ''; > vidz.player.stop(); > } > > private function poolFilter():void{ > poolSelected = pool_ckb.selected; > > filterGrid(); > currentState = ''; > } > > private function yardFilter():void{ > yardSelected = yard_ckb.selected; > > filterGrid(); > currentState = ''; > } > > private function closetFilter():void{ > closetSelected = closet_ckb.selected; > > filterGrid(); > currentState = ''; > } > > private function garageFilter():void{ > garageSelected = garage_ckb.selected; > > filterGrid(); > currentState = ''; > } > > private function tileflrFilter():void{ > tileflrSelected = floor_tiles.selected; > > filterGrid(); > currentState = ''; > } > > private function hardwoodflrFilter():void{ > hardwoodflrSelected = hardwood_floors.selected; > > filterGrid(); > currentState = ''; > } > > private function laminateflrFilter():void{ > laminateflrSelected = laminate_floors.selected; > > filterGrid(); > currentState = ''; > } > > private function balconyFilter():void{ > balconySelected = balcony.selected; > > filterGrid(); > currentState = ''; > } > > up to this point all is good. the problem is when i try to assign dataAr to > copydataAr > > private function cloneCollection(dataAr:ArrayCollection):ArrayCollection{ > var copydataAr:ArrayCollection = new ArrayCollection(); > copydataAr.source = copydataAr.source.concat(dataAr.source); > return copydataAr; > that is where am having a problem and also how to apply the change effect > when data is removed or added. >