Infinite scrolling table views
Closed this issue · 8 comments
- Rather than pagination buttons, scrolling to within 150px of the footer should trigger a new page load (new tbody) into the table.
- Not pjax, just ajax fetches. No need for deep-linkable replaceState in browser history.
- Changing sort or filter settings resets to showing only a single page of results.
Ok, perfect, i've got it
Realizing I neglected to mention new tbody tags will be appended to the table, not replacing the existing tbody. Just adding for posterity.
This is calling location.getParameter which is not native. Is there an implementation of getParameter that should have been supplied? There's a simple deparam implementation at the top of https://github.com/sunlightlabs/Capitol-Words/blob/master/cwod_site/media/js/capitolwords.coffee if it helps at all.
Also just now noticing that the js here runs on a 1-second interval to check scroll position. Can we bind to the window's scroll event instead?
Yep. You are right. Thanks for the feedback
On Apr 18, 2012, at 22:26, Dan Drinkardreply@reply.github.com wrote:
Also just now noticing that the js here runs on a 1-second interval to check scroll position. Can we bind to the window's scroll event instead?
Reply to this email directly or view it on GitHub:
#31 (comment)
I've changed the code according to your comments.
Thank you for the getParamenter feedback, i didn't knew about the compatibility.
Ok this works. Couple of small things still:
- Should only make one pagination request at a time. Speed with which the scroll event fires can lead to out-of-order loading
- Should stop trying to load more pages after receiving the first empty result set (ie., last page is reached).
Sooooo close! Need to reset infinite scroll after changing sort settings.