It sounds like you are setting the scrollPosition before the data is 
returned.  Because the data is returned asynchronously, you should 
probably set the scrollPosition in the data call's onReturn 
handler.  Or, add an dataChanged eventListener to the grid, that 
executes a funcion to reset the scrollPosition.

-TH

--- In flexcoders@yahoogroups.com, "djbrown_rotonews" 
<[EMAIL PROTECTED]> wrote:
>
> I actually tried this (my dataProvider for the grid is an 
> XMLListCollection being populated by a jsp. The grid has custom 
item 
> renderers if that's relevant).
> 
> anyhow, I have an "update" button which will call the jsp and get 
> new results when clicked. I've set it up so the click() method 
> correctly captures the scroll position, calls the jsp, and then 
sets 
> the scrollToIndex to the previous value of the scroll position. It 
> works great while the "busy cursor" is displayed, but it reverts 
> back to scrolled all the way at the top once the actual data comes 
> in from the jsp (it takes about 3 seconds to update the grid with 
> the new data).
> 
> any ideas on where the scroll position is being reset?
> 
> --- In flexcoders@yahoogroups.com, "Deepa Subramaniam" 
> <dsubrama@> wrote:
> >
> > Hi Jordan -
> > 
> >  
> > 
> > You can keep track of the verticalScrollPosition property in your
> > DataGrid and upon receving UPDATES, re-set the 
> verticalScrollPosition to
> > the previous value and the DataGrid will jump to the last scroll
> > position and show the correct content. 
> > 
> >  
> > 
> > -deepa
> > 
> >  
> > 
> > ________________________________
> > 
> > From: flexcoders@yahoogroups.com 
> [mailto:[EMAIL PROTECTED] On
> > Behalf Of Jordan Snyder
> > Sent: Monday, June 26, 2006 7:34 PM
> > To: flexcoders@yahoogroups.com
> > Subject: [flexcoders] Keeping DataGrid from scrolling to top on 
> update
> > to dataProvider
> > 
> >  
> > 
> > Hello All,
> > 
> > I am working on an app in which I poll the server quite 
frequently 
> to
> > get new information.  The information comes to me in an XML 
format 
> that
> > I simply assign as the dataProvider for a DataGrid component. 
> > 
> > I have to keep in consideration the fact that the user may have 
> selected
> > a certain row, and may want to delete that row even after an 
> update to
> > the dataProvider is made, so I keep track of the selectedIndex 
> property
> > and reselect upon an update.
> > 
> > But if the user has not selected a row, the DataGrid will 
> automatically
> > scroll to the top upon an update, even if the user has scrolled 
to 
> the
> > bottom of the grid.  
> > 
> > Is there a way around this?  I found a way to scrollToIndex(), 
but 
> no
> > way of getting the currently viewed items.  It may have 
something 
> to do
> > with the various renderer properties available on the DataGrid, 
> but I
> > have a very limited understanding of this, so it's over my head.
> > 
> > Surely this problem has been run into before, but I can't seem 
to 
> find
> > the right combination of search terms to figure out a method of 
> solving
> > it.
> > 
> > Does anyone have any ideas or proven methods for the problem?  
Any 
> help
> > would be greatly appreciated.
> > 
> > Thank you,
> > 
> > Jordan Snyder
> > jordan.snyder@
> > www.jordansnyder.com
> >
>






------------------------ Yahoo! Groups Sponsor --------------------~--> 
Great things are happening at Yahoo! Groups.  See the new email design.
http://us.click.yahoo.com/TISQkA/hOaOAA/yQLSAA/nhFolB/TM
--------------------------------------------------------------------~-> 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to