3 Replies Latest reply on May 15, 2010 10:03 PM by Flex harUI

    Removing ListCollectionView & FilterFunction - Data not being refreshed

    sleblang Level 1

      What would cause a SkinnableDataContainer's (SDC) data to not be properly refreshed once a filterfunction and ListCollectionView is removed?


      I am creating a ListCollectionView on an arrayCollection, which is used for the SDC's dataProvider. I am then setting a filter function on the new ListCollectionView, refreshing it, and then setting the SDC's dataProvider to the new ListCollectionView. Everything works fine until I want to remove the ListCollectionView and restore the old arrayCollection as the dataProvider. The SDC does not show all of the items. Below is the code I am using.

       

       

      // create the new LCV and set filterFunction
      
                          searchCollection = new ListCollectionView();
                          searchCollection.list = model.allAssets
                          searchCollection.filterFunction = filterSearch;
                          searchCollection.refresh();
                          dataGroup.dataProvider = searchCollection;
      
      // remove LCV and restore original array collection as dataProvider
      
                          searchCollection.filterFunction = null;
                          searchCollection.refresh();
                          dataGroup.dataProvider = model.allAssets;