Fwd: [flexcoders] Re: AdvancedDataGrid preserve openItems after data update

2008-06-24 Thread berenger_kc
Hi,

I did not fully understand how did how built objects or matched items.

Could you be more explicit or could you show part of your code ?


Thanks.



--- In flexcoders@yahoogroups.com, jonese <[EMAIL PROTECTED]> wrote:
>
> 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




Fwd: [flexcoders] Re: AdvancedDataGrid preserve openItems after data update

2008-05-05 Thread jonese
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 flexcoders@yahoogroups.com, "Eric Jones" <[EMAIL PROTECTED]> wrote:
>  >
>  > Did you ever figure out how to do this?
>  >
>  > jonese
>  >
>  >
>  > --- In flexcoders@yahoogroups.com, "smelbyfastlane"  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
>  > >
>  > >
>  > >
>  > >   > > height="100%">
>  > > 
>  > >   > > source="{flatWorkItemsAC}">
>  > > 
>  > > ...
>  > > 
>  > > 
>  > > 
>  > > ...
>  > > 
>  > >
>  >
>
>  


[flexcoders] Re: AdvancedDataGrid preserve openItems after data update

2008-04-24 Thread sameerbhatt13
Can you post a sample in which the issues occurs?

- Sameer

--- In flexcoders@yahoogroups.com, "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 flexcoders@yahoogroups.com, "Eric Jones"  wrote:
> >
> > Did you ever figure out how to do this?
> > 
> > jonese
> > 
> > 
> > --- In flexcoders@yahoogroups.com, "smelbyfastlane"  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
> > > 
> > > 
> > > 
> > >  > > height="100%">
> > > 
> > > > > source="{flatWorkItemsAC}">
> > >
> > > ...
> > >  
> > >   
> > >
> > > ...
> > > 
> > >
> >
>




[flexcoders] Re: AdvancedDataGrid preserve openItems after data update

2008-04-23 Thread rockstar77877
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 flexcoders@yahoogroups.com, "Eric Jones" <[EMAIL PROTECTED]> wrote:
>
> Did you ever figure out how to do this?
> 
> jonese
> 
> 
> --- In flexcoders@yahoogroups.com, "smelbyfastlane"  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
> > 
> > 
> > 
> >  > height="100%">
> >   
> >   > source="{flatWorkItemsAC}">
> >  
> > ...
> >
> > 
> >
> > ...
> > 
> >
>




[flexcoders] Re: AdvancedDataGrid preserve openItems after data update

2008-04-18 Thread Eric Jones
Did you ever figure out how to do this?

jonese


--- In flexcoders@yahoogroups.com, "smelbyfastlane" <[EMAIL PROTECTED]> 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
> 
> 
> 
>  height="100%">
> 
> source="{flatWorkItemsAC}">
>
> ...
>  
>   
>
> ...
> 
>