How to handle infinite vertical scrolling finish event?

How to handle infinite vertical scrolling finish event?

javadshareefmajavadshareefma Posts: 3Questions: 0Answers: 0
edited February 2013 in General
Hi Friends,

I need to handle infinite vertical scrolling loading finish event. My requirement is to send an Ajax call to my server when users viewed all populated data table records .

Replies

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    Infinite scrolling in DataTables means just that - it is infinite. If you have a finite set of data, I'd encourage you to look at using Scroller.

    Allan
  • javadshareefmajavadshareefma Posts: 3Questions: 0Answers: 0
    Thank you for your reply allan,
    What I mean is, Say I have a 500 records in my table and user should go through these 500 records before going to next stage. I am using server side processing for generate data source as like data source processed in http://www.datatables.net/examples/data_sources/server_side.html, and using infinite vertical scrolling. So, I need to handle data source loading finish event to trigger an Ajax call.
  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    500 !== infinity, so I don't quite understand why you are using infinite scrolling? Why not just disable infinite scrolling? As I say, there is no 'end' event when infinite scrolling is used, since there is no end.

    You can tell when the Ajax has completed by using the `xhr` event - http://datatables.net/docs/DataTables/1.9.4/#xhr . But I don't know if that is what you want.

    Allan
  • javadshareefmajavadshareefma Posts: 3Questions: 0Answers: 0
    Thank you allan,
    Yes. This is exactly I want. [code]xhr[/code] event will solve my issue. Thanks for your help.

    Regards,
    Javad Shareef
This discussion has been closed.