0 Replies Latest reply on Jul 2, 2009 1:23 AM by nikos101

    its near impossible to get a Advanced datagrid to remember its opened nodes when it has fresh data

    nikos101 Level 2

      Theres a post in

       

      http://www.mail-archive.com/flexcoders@yahoogroups.com/msg85521.html//www.mail-archive.com/flexcoders@yahoogroups.com/msg85521.html

       

      which is basically saying its near impossible to get a Advanced datagrid to remember its opened nodes when it has fresh data

       

       

      I'm having pretty much the same problem (exept I'm not filtering just getting the latest data from the server)as this guy and have been searching for a solution, heres what he said:

       

      Sun, 02 Mar 2008 08:07:46 -0800

      Hello guys,

      I'm trying to filter my ADG without success :

      I created a GroupingCollection from a flat ArrayCollection.

      ADG's dataProvider is GroupingCollection.

      First issue : refresh
      if I filter the underlaying ArrayCollection, the related
      groupingCollection doesn't refresh automatically (bug? feature?)

      Actually I menaged to force gc.refresh() with some event( it is
      impossible to listen on CollectionEventKind.REFRESH because of
      infinite loop ac.refresh => gc.refresh )

      Second issue (more important) : openNodes
      Ok now that my gc is refreshed, the Tree in the ADG collapses itself
      (ok let say that is normal), and I need it to expand all nodes that
      were opened before.

      I tried to do something like this :

      var openNodes : Object = IHierarchicalCollectionView(
      myADG.dataProvider ).openNodes;

      gc.refresh();

      myADG.dataProvider.openNodes = openNodes;

      and it doesn't works.

      next I tried this :
      var openNodes : Object = IHierarchicalCollectionView(
      myADG.dataProvider ).openNodes;
      for each( var node : Object in openNodes )
      {
      IHierarchicalCollectionView( myADG.dataProvider.openNode( node )
      }

      guess what, doesn't work

      I'm calling myADG.invalidateList() each time too.

      I don't know what to do to achieve this simple task, I'm a bit
      disappointed because I expected lot more from the brand new
      AdvancedDataGrid and this basic functionality actually seems too hard
      to implement.

      I still hope I'm wrong and someone can show me the correct solution

      Thank you all,
      Adnan