PDA

View Full Version : Custom vertical scroll grid load location



derekvre
26 Oct 2010, 2:03 PM
I am modifying the Feed Viewer example to auto-refresh the topics grid every minute but I would like to auto-scroll the refreshed grid to the last vertically scrolled position the user was located.

I can't seem to locate an event method which I can call which runs late enough to do this. It always scrolls back to the top after loading. Is there is a setting somewhere which will prevent the grid from scrolling to the top again?

I've looked in the Ext.grid.GridPanel, Ext.grid.GridView, Ext.data.Store, Ext.TabPanel, & Ext.LoadMask
and I can't find anything.

Samuel.reed
24 Nov 2010, 7:22 AM
Hello Derek, have you found any answer to your problem? I am experiencing a similar problem and have been looking for a solution for some time.

Animal
24 Nov 2010, 7:36 AM
gridView.scroller is the overflow:auto element which contains gridView.body

gridView.body is emptied and has a completely new blob of innerHTML dropped into it when refreshed, so gridView.scroller does not really scroll to the top on refresh. It just starts at the top because it is reset to be empty and then gets next content put in.

You must store the offsetTop of the scroller, and restore it after a load.

derekvre
1 Dec 2010, 8:07 AM
Thanks so much for your help on this Animal. I'm currently not working on this task any longer to verify it but will try to when I can. Thanks again!