-
-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can this library provide support for infinite scrolling ? #5
Comments
That is one of the use cases, but it hasn't been fully implemented yet. |
It would be very interesting to see it an action for infinite scrolling of tables and lists! 👍 |
+1 - My most wanted feature in Aurelia at the moment. |
I have a hunch this won't be too hard to implement. I'll give this and the scroll position issue a go in my fork. |
Added infinite scroll support to my fork: https://github.com/rquast/ui-virtualization/commit/5ab12e084ee17c3faaa8dc43dab6ad316f5b335c Just implement either loadTop() or loadBottom() in your view model/custom element like this... loadBottom() { Also use splice rather than push for modifying arrays (I don't know if that's fixed now or not?). |
Hi, this would be a very useful feature (virtual-scroll), looking forward to it :) it would be nice to be able to use different heights for rows and be able to see full scroll height from the beginning, and also to be able to load all data into a object for faster rendering instead of many requests based on scroll height (optional). Thank you for your work! |
+1 |
2 similar comments
+1 |
+1 |
+1 This, along with horizontal lists, would be quite helpful for a current project. |
@TheBerleyman: #59 for horizontal scrolling |
Made a pull request for basic infinite scroll support. I'd appreciate feedback: #71 |
👏 well done! 👍 |
@martingust Did you rebuild dist after adding this? Doesn't look like its in there (just trying it out now). |
It's there @rquast https://github.com/aurelia/ui-virtualization/blob/master/dist/amd/virtual-repeat.js#L327 |
my package.conf I did a grep on the repeat-next and RepeatNext in dist
|
So then what isn't working? |
Sorry.. my bad.. I was in the wrong directory. I just can't get it to fire getMore (from the example). |
Can you post a snippet of what you're trying to do? There's a current issue where it can only call the function referenced in the |
The add more works, but getMore doesn't when it scrolls. I put in a few extra divs because I know virtual repeat needs containers. |
Nix the |
Yeah I originally didn't have it.. added that to try just in case. |
This infinite scroll implementation is a bit limited, I would definitely classify it as a first draft. We needed it for our application, so we got the bare minimum in there to start it off. It would be great to have some more features for this. |
#74 - will leave it there for now since things work on my side with that patch. Either my code there doesn't work properly (which I think it does), or the test is broken for fixed height containers. If I get some time, I'll look into it some more. |
In the past I have used Infinity from AirBnb and loved it's capability to free up resources as items paged off of the screen (http://airbnb.io/infinity/). I have built a couple of js apps where I needed to scroll through 10k-50k images or cards (image with some text). I finally hit the limit on what a javascript array could handle and started hacking infinity.js to have it use a better data structure but then my use case ended up not needing such a large list of items. Most "infinite" scroll solutions keep the items in the DOM and eventually the browser slows to a crawl. I am not really experienced enough in js or Aurelia and my first app that I am building in Aurelia right now doesn't need this but I do have one coming down the pike...... would love an advanced infinite scroll built into Aurelia. I think that this could be a big factor in the Angular/Aurelia shootout. IMHO. |
@gregorydickson You are in the right place to see that. |
ahh, just noticed, thanks!!!!!! my bad for not RTFM. |
@gregorydickson, we're using this plugin in production and have tested it with over 100k items, so it's definitely good to go DOM wise. What we've noticed (however) is that older devices that don't quite have the memory start to struggle with JS arrays that go beyond 150k (crashing and the such). |
@AStoker nice!!!! thanks for the info. |
If I can chime in here, I find aurelia-virtualization to be very useful. One thing I am not comfortable is that it uses timer firing every 500 ms. This is something I would like to avoid in our app. As I understand the timer is needed in some special cases. If those cases are not needed in normal situations, I would suggest this is made as opt-in feature for those special situations. |
@ppN2, I understand the desire to not have a timeout firing that frequently. As of right now it is needed to help catch cases where the repeater is hidden initially, or if the user scrolls faster than the JS can render items (in which case it helps in the catch up). Not sure if either of those situations could be refactored into options... But If you have an idea on how to handle those two situations without a timeout, I would love to hear them. Every time I see a timeout, red flags typically go up in my head :) |
I just implemented this on my app. It rocks!!!! Thanks: @AStoker @EisenbergEffect |
A canonical example in an app is loading more data when the user reaches the bottom of the page.
Can the ui-virtualization lib provide this service?
thanks.
The text was updated successfully, but these errors were encountered: