Hybrid View

Is there any way to keep scroll position of Grid on load

I've read the previous thread "Grid Loses Selection and Scroll Position On Data Store Load" and tried the way to restore scroll position after ds.load. It works, but "However there is still a visible twitch in the grid as it scrolls to the top and then back to the restored position.", I also tried :

I think the option to turn off redraw grid while only update data in it is very important requirement. The typical usage such as real time stock quotes display has to have this option, or it can't work well, obviously. So can Ext team put some effort on it?

It's a bit of a hack, but if you create your grid as shown below, the grid scroll position will stay where it is when the data store is reloaded. The selection remains the same as well. The onLoad() function of the grid calls scrollToTop(). By eliminating scrollToTop(), the grid no longer moves when it is reloaded. The only drawback is that you can no longer call scrollToTop() on the grid.

An alternative would be user Ext.override() to add a new method to the gridView that implements a copy of the scrollToTop() method. Then, override the built-in scrollToTop() method pointing it at the emptyFn() function, as mentioned above.

Now, if you need to actually scroll to the top, you call your own scrollTop() method.

Yet another alternative is to use the override mentioned in the post above, and then simply access the gridView's scroller and call it's built-in scrollTo() method. Assuming "grid" is a variable holding a reference to your grid, you can do:

Code:

grid.getView().scroller.scrollTo('top', 0);

Additionally, this approach means you can animate the scroll, if you choose:

Any and all code samples that are authored by me and posted on the Ext forums or website are hereby released into the public domain and I release anyone or entity of liability by using said code samples unless explicitly stated otherwise.

Opinions are mine and not necessarily endorsed by Ext, LLC. Please do not contact me directly for assistance unless requested by me.

How do I achieve this in Ext GXT.? I tried overriding scrollToTop method making it do nothing, but the scroll behavior is still there. I tried setting preventScrollToTopOnRefresh to false, still doesn't work.
Has anyone solved this for Ext GXT?