What does data.draw and setTimeout do ?
What does data.draw and setTimeout do ?

https://datatables.net/extensions/scroller/examples/initialisation/server-side_processing.html.
In this example we come across a setTimeout function. Could any one explain to me what is happening in that code?
setTimeout( function () {
callback( {
draw: data.draw,
data: out,
recordsTotal: 5000000,
recordsFiltered: 5000000
} );
}, 50 );
This discussion has been closed.
Answers
It's faking an ajax call. Because the function is just creating the data (in the lines above what you pasted), it then creates a small delay, and passes that back to DataTables to emulate a real Ajax call.
Not useful practically, but good for demonstrating how Scroller can be used with limitless amounts of data.
Colin
So, how would we be using or calling ajax with scroller in real world application ?
The same as you would here. There, it would just call your end-point to get the data.
Colin