I need example for Infinite Scroll(Load data on scroll)
I need example for Infinite Scroll(Load data on scroll)
![Abhi R](https://secure.gravatar.com/avatar/4b330f7bdb6deec658ad298c16d8c1fd/?default=https%3A%2F%2Fvanillicon.com%2F4b330f7bdb6deec658ad298c16d8c1fd_200.png&rating=g&size=120)
Hello All,
I need an example for Infinite Scroll.
For example: - At first, there are 20rows in datatable. After I scroll down there should be an ajax call that should get next 20rows and display it.
Can anyone send the example for that
Thanks,
Abhi R
This discussion has been closed.
Answers
Sounds like you want to use the scroller extension:
https://datatables.net/extensions/scroller/
Kevin
Hello @kevin
Consider there are around 100rows in the database.
on start in need only 20rows. when I scroll down in datatable, there should be an ajax call to get next 20rows.
But scroller will get all the data at the ones. I don't want like that.
https://datatables.net/forums/discussion/43486/destroy-is-not-working#latest
**Not one that I've published. But you could just listen for the scroll event and then use rows.add() to add newly loaded rows.
Allan**
@allan![:smile: :smile:](https://datatables.net/forums/resources/emoji/smile.png)
Thanks for the reply
If you get(develop) anything in future let me know![:tongue: :tongue:](https://datatables.net/forums/resources/emoji/tongue.png)
@Abhi,how did you send the ajax call indicating rows from 21 to 40.can u please send a sample code for this
Hi, is there a way to listen to scroll event?? I didn't find it in the docs (https://datatables.net/reference/event/)
I need to do an infinite scroll, that is, ajax requisition as user scrolls down and there is no more data to bem shown. Is there a way to do it with scroller extension??
Thanks