PDA

View Full Version : Infinite Scroll Grid scrollbar position behavior



incutonez
4 Jun 2014, 9:33 AM
I'm curious to know what the expected behavior of the Infinite Scroll Grid Example's (http://docs.sencha.com/extjs/4.2.1/extjs-build/examples/grid/infinite-scroll.html) scrollbar is. If I'm in Firefox, load that page, scroll all the way to the bottom, and then refresh the page, the grid scrolls to the bottom. If I'm in Chrome, and do the same thing, the grid does not scroll to the bottom... it stays at the top... this is the behavior I'm expecting, but which is right, and is the former a bug?

Phil Guerrant
4 Jun 2014, 11:00 AM
it is simply a matter of browser behavior. Some browsers preserve the scroll position of overflowing elements between page refreshes, while others do not. Ext JS does not attempt to normalize these differences.

You will see the same effect in a plain html example


<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div style="height:100px;width:100px;overflow:auto;">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</div>
</body>
</html>

incutonez
4 Jun 2014, 11:21 AM
Interesting. Thank you for that concise example. And I was actually thinking it was browser based. I'm assuming there's no way for Ext to override this? It would have to be up to the user to change these settings in the browser somewhere?

Phil Guerrant
4 Jun 2014, 11:24 AM
not sure if this behavior can be controlled using browsers settings. you'd probably have to save and restore scroll position yourself using a cookie or localstorage

Phil Guerrant
4 Jun 2014, 11:27 AM
It would probably be possible for the framework to save and restore scroll positions, but it's not something that's really on our radar at the moment. Would probably make a good user extension (http://www.sencha.com/forum/forumdisplay.php?82-Ext-User-Extensions-and-Plugins) though ;)

incutonez
4 Jun 2014, 11:30 AM
not sure if this behavior can be controlled using browsers settings. you'd probably have to save and restore scroll position yourself using a cookie or localstorage

Yup, and that's sort of what I'm working on now.


It would probably be possible for the framework to save and restore scroll positions, but it's not something that's really on our radar at the moment. Would probably make a good user extension (http://www.sencha.com/forum/forumdisplay.php?82-Ext-User-Extensions-and-Plugins) though ;)

Agreed. Thank you very much for the clarification!