Skip to content
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

Adding a callback function for when the list is exhausted #11

Closed
MicJarek opened this issue May 23, 2022 · 3 comments
Closed

Adding a callback function for when the list is exhausted #11

MicJarek opened this issue May 23, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@MicJarek
Copy link

Is there a way to implement a Callback function when the list is completely shown (and the ‘More’ button is hidden)? Meaning, when the last items are displayed to the user, is there a way that I can detect that and trigger a function of my own to do additional processing.

What I’m trying to do is get the next set of records from the database (via AJAX) so the user can ‘transparently’ continue viewing them, until all the records are exhausted.

BTW: I have implemented simple-load-more throughout the app and it works great! I think adding this little feature will make it a more robust tool since it will then not be limited to just the initial retrieve/list display.

@zeshanshani zeshanshani added the enhancement New feature or request label May 29, 2022
@zeshanshani
Copy link
Owner

@MicJarek another great suggestion!

I will implement this during the next week.

@zeshanshani
Copy link
Owner

@MicJarek this feature has been implemented!

We have three callbacks now:

  • onLoad fires when instance is fully loaded
  • onNextLoad fires every time next batch of items are laoded
  • onComplete fires when all items are loaded

For more details, check out README file: https://github.com/zeshanshani/simple-load-more and view our demo.

@MicJarek
Copy link
Author

MicJarek commented Jun 13, 2022

  • onLoad fires when instance is fully loaded
  • onNextLoad fires every time next batch of items are laoded
  • onComplete fires when all items are loaded

That's perfect @zeshanshani. The onComplete works great. Tks... :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants