OK here's what i did to keep my nodes open.

un my update function i call preventDefault() to stop the expected operations.

then i manually build using updated data my object instances
then search the original objects till i find my matching object
overwrite the orginial object with the new instance
then run a refresh() on the dataprovider.

This appears to be working for me and it is having the expected
results.....so far :)

-- 
jonese
http://www.jonese.us
http://twitter.com/jonese


On Wed, Apr 23, 2008 at 9:27 PM, rockstar77877 <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
>
> Scott and Jonese:
>
>  I am currently trying to deal with the same issue. I was
>  actually ALMOST there, but I think I have discovered a bug in Flex.
>
>  So the problem: Keeping the AdvancedDataGrid nodes that were already
>  expanded, open after a filter and refresh (specifically
>  a 'GroupCollection' refresh).
>
>  First, I got a nice array of objects containing the 'nodes' for the
>  grid nodes that were opened, "adg.dataProvider.openNodes"
>  Next, I did the filter and gc.refresh().
>  The final step was to iterate through all the nodes, find out which
>  ones had the same "GroupLabel," and expand them
>  using "adg.dataProvider.openNode(node:Object)".
>
>  This is where I ran into problems. When I tried to re-open a node
>  using openNode, the node would expand, but the nodes below it would
>  not be in the right tree level (it seems as if they were stepping
>  down in level one by one, even though they were supposed to be all on
>  the same level below it). Now here is a real kicker! If I go to
>  click on anything in the grid after that, the display automatically
>  corrects itself! So odd.
>
>  If anyone has seen the same thing, or know what I'm even talking
>  about please let me know. Thanks!
>
>  rockstar
>
>
>  --- In [email protected], "Eric Jones" <[EMAIL PROTECTED]> wrote:
>  >
>  > Did you ever figure out how to do this?
>  >
>  > jonese
>  >
>  >
>  > --- In [email protected], "smelbyfastlane" <smelby@> wrote:
>  > >
>  > > Hello -
>  > >
>  > > I am using an AdvancedDataGrid to display data that is retrieved
>  > > periodically from a HTTPService. When handling the result event I
>  > > parse the lastResult e4x into typed objects and put them into an
>  > > ArrayCollection which is the source for a GroupingCollection as
>  laid
>  > > out below. After doing all of this I call groupedData.refresh()
>  to
>  > > get my new data displayed. All of this works fine, except that
>  after
>  > > calling groupedData.refresh() my group nodes (in the grid) are all
>  > > collapsed. I have tried saving workItemsGrid.openItems into a
>  temp
>  > > variable, then setting it back after calling refresh... but that
>  does
>  > > not work. I am guessing that this is due to the fact that my data
>  > > provider has entirely different object instances than it had
>  > > previously. But, I am open to the idea that I just did it
>  incorrectly
>  > > somehow. Based on my thought that I have different objects in
>  the DP
>  > > than I did before I figured I could just save off the value of
>  > > "GroupLabel" for each openItem, call refresh(), then iterate over
>  the
>  > > group objects and call workItemsGrid.expandItem() for each that
>  has a
>  > > GroupLabel that was previously open. The problem with this
>  approach
>  > > is that I have not yet been able to figure out how to iterate
>  over the
>  > > groups.
>  > >
>  > > Any help in getting my previously open items to re-open is greatly
>  > > appreciated.
>  > >
>  > > Thanks in advance
>  > > Scott
>  > >
>  > >
>  > >
>  > > <mx:AdvancedDataGrid id="workItemsGrid" width="100%"
>  > > height="100%">
>  > > <mx:dataProvider>
>  > > <mx:GroupingCollection id="groupedData"
>  > > source="{flatWorkItemsAC}">
>  > > <mx:Grouping>
>  > > ...
>  > > </mx:Grouping>
>  > > </mx:GroupingCollection>
>  > > </mx:dataProvider>
>  > > ...
>  > > </mx:AdvancedDataGrid>
>  > >
>  >
>
>  

Reply via email to