Scroller 1.2.2 and Datatables 1.10 continually requesting data
Scroller 1.2.2 and Datatables 1.10 continually requesting data
I'm using scroller 1.2.2 with datatables 1.10.
When I scroll down and the next batch starts loading, any micro-scrolls after that will create a new request to the server whether I use deferRender or serverWait (undesirable). I can't seem to tune it properly so that it is NOT continually requesting chunks while unneeded scrolling is occuring during a load.
It's the same problem as https://datatables.net/forums/discussion/17514/scroller-too-often-server-side-call-when-scroll-to-top, but displayBuffer does not solve the issue.
Any thoughts?
<script type="text/javascript">
$(document).ready(function() {
var dtable = $('#example').dataTable( {
autoWidth : true,
order : [ 0, "desc" ],
processing : true,
paging : true,
dom: "frtiS",
scrollY : 500,
serverSide : true,
stateSave : false,
stateDuration : 120,
ajax : "xxxxxxxxxxxxxxxxxx",
"rowCallback": function( row, data ) {
row.setAttribute('id', data[0]);
},
scroller: {
displayBuffer: 5
},
columnDefs : [
{targets : [0], visible : false, searchable : true},
// name
{targets : [1], width : "20%",
render: function ( data, type, row ) {
return '<span class="org_name">'+data+'</span><br>'+row[4];
}
},
// actions
{targets : [2], width : "5%", orderable : false, className : "alignverticalmiddle center"},
// contact
{targets : [3], width : "15%", orderable : false, className : "breakword"},
{targets : [4], visible : false, orderable : false},
// plan
{targets : [5], width : "7%", orderable : false},
// order date
{targets : [6], width : "7%"},
// urls
{targets : [7], width : "5%", orderable : false, searchable : false, className : "alignverticalmiddle center"},
// server
{targets : [8], width : "10%"},
// setup
{targets : [9], width : "3%", className : "alignverticalmiddle center"},
// fav
{targets : [10], width : "3%", className : "alignverticalmiddle center"},
// promotion
{targets : [11], width : "10%"},
// affiliate
{targets : [12], width : "10%"},
// tags
{targets : [13], width : "10%", orderable : false},
]
} );
Answers
When the table is fetching more records, scrolling up or down just keep generating requests with every wheel turn.