0

I am using ASP.NET MVC and initially the HTML table data is loaded from the server (loop data using razor).

In document.Ready() I am applying jQuery datatable on the HTML table. All data is returned from the server. I just need to show it 10 rows every page scroll.

How to make the datatable load more data on page scroll?

var table = $('#reports_total_spend_table').DataTable({
           "order": [[1, 'asc']],
           paging: false,
           searching: false,
           info: false,
           fixedHeader: true,
           scrollY: "450px",
           scrollX: true,
           scrollCollapse: true
       });
zsltg
  • 725
  • 5
  • 14
  • 23
rab mat
  • 1
  • 1
  • Does this answer your question? [jQuery load more data on scroll](https://stackoverflow.com/questions/14035180/jquery-load-more-data-on-scroll) –  Mar 31 '20 at 15:37
  • The data is not big. so i showed first 10 rows and hided the other rows. then i started showing 10 rows each page scroll. $(window).on("scroll", function () { if ($(window).scrollTop() + window.innerHeight > $(document).height() - 50) { $("tbody tr.main:hidden:lt(10)").removeClass('hidden'); } }); – rab mat Apr 02 '20 at 09:11

0 Answers0