-
Notifications
You must be signed in to change notification settings - Fork 17
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't implement infinite data load with this scroll #27
Comments
Although I did not try it, you can probably use the html<div malihu-scrollbar [scrollbarOptions]="scrollbarOptions">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua...
</div> typescriptpublic scrollbarOptions = {
axis: 'y',
theme: 'minimal-dark',
callbacks: {
onTotalScroll: () => {
// load new data
}
}
}; Note that you might have to update the scrollbar to resize it once the new items have been added to your container with |
Hi jfcere, Thanks for your reply. I have already seen this callback method but I want this method to trigger prior 10% of total data scrolled in other words if I have 100 rows so it should trigger of 80th record number. To achieve these kinds of requirement I'm using InfiniteScroll v0.8.2 package which provides me properties like - infiniteScrollDistance, infiniteScrollUpDistance, infiniteScrollThrottle etc., see this plnkr https://plnkr.co/edit/DrEDetYnZkFxR7OWWrxS?p=preview but this seems not working with our scrollbar. Regards, |
Thx for the plunker, give me some time to take a look at it and i'll come back to you... hopefully we'll get a way to make it work! |
Hi Jfcere, Hope you are having a great day so far! Regards, |
@kundan-kumar1993 sorry I didn't 😞 |
Hi @jfcere How to achieve our requirement (this would be your feature enhancement as well) - we can implement another version of onTotalScroll where we can provide the bottom percentage point of the scroll nob relatively to the scroll container (i.e, 2 (2 * 10 = 20%) is event is triggered when 80% (100% - 20%) has been scrolled). Also, this property should be that much smart which track when I finish with my data append on bottom of the page, in other words - If I have 100 records and loading 50 records at a time soon very first load of page scroll will fire the callback for other 50 records and when it append those records and become 100 after that event should not fire on bottom scroll. Hope I am clear for you, anyway let me know if I can help you somehow? Regards, |
Hi @jfcere |
Sorry for the delay, I took some time yesterday to look at it and so far it is not working but here is what I discovered along the way. There is an issue on original Malihu-Cutom-Scrollbar-Plugin on the fact that it cannot work with an infinite scroll plugin, you have to do it with the callbacks functions from the plugin (see reference: malihu/malihu-custom-scrollbar-plugin#57). So I tried it with this Plunker based on the previous issue recommendations. But so far I've been able to update the array when I get to the bottom of the scrolling element but the UI is not updating so we do not see the new items being rendered. I did not have more time for now to try to make it work but I can get back to it this weekend. |
Hi @jfcere , I'm facing the same issue in Angular12. This plugin is most helpful in my project. Can you please Look into this? |
Hello,
I've implemented this scroll in my grid table and now I want to implement infinite scroll with this as well using the same container, it seems not possible so far as onscroll event not getting fire on malihu scrolling.
Please anyone suggest me how I can do that?
Thanks in advance!
Regards,
Kundan
The text was updated successfully, but these errors were encountered: