Using server side processing and trying to do infinite scroll
Using server side processing and trying to do infinite scroll
I am trying to fetch data from server side, so I have ajax and serverside configured on my datatable. What I'd like to do is to capture the scroll event when it hits the bottom of the page and fetch the next page such that I have page 1 and 2 in the memory.
So I am stuck at a point where when I get the next page using jquery ajax (because I can't use any of the datatable apis for this, or maybe I just don't know which one). I am trying to append the new rows to the datatable using dt.rows.add api. This doesn't update the UI and per documentation I need to call the draw function, dt.rows.add( rows ).draw( 'full-hold' );
This call does its own ajax call to the server and replaces the data that I just fetch with its own version. I don't want the ajax call be invoked by the draw. Is there a way?
Or if I am doing this completely wrong please advise how can I used the datatable params (search, filtering parameters) to fetch data from backend and append the data to the jquery datatable.