Scroller plugin with server-side AJAX sending double value for iDisplayStart

Scroller plugin with server-side AJAX sending double value for iDisplayStart

jpnh7jpnh7 Posts: 1Questions: 0Answers: 0

With my use of the Scroller plugin, when I scroll to the point where we must fetch data, iDisplayStart is being set to a fractional number, e.g. 348.5. The server expects an integer and therefore an error occurs. I could just truncate and continue to fetch data, but this seems like a problem with my Scroller configuration and I think it would be better to fix the issue there.

Does anyone have any theories why Scroller might send a fractional iDisplayStart when the API states this must be an integer?

Some hopefully helpful info:

Total records: 24215
Number of visible rows in display: 13.5

Request headers:

sEcho:2
iColumns:6
sColumns:
iDisplayStart:348.5
iDisplayLength:510
...

Part of the DataTables config:

  bProcessing : true,
  bAutoWidth : false,
  bFilter : true,
  sScrollY : "400px", /* dynamically adjusted based on the height of the viewing area by manipulating the height of '.table_scrollBody' */
  sDom : 'rtiS',
  bDeferRender : true,
  bServerSide : true,
  oScroller: {
    loadingIndicator: true,
    displayBuffer: 30,
    boundaryScale: .7,
    rowHeight: 24 /* dynamically derived from the size of the header rowcalculated, but known to equal 24 when the bad ajax request is made */
  },

Function to adjust _scrollBody height:

var $mainWrapper = $('#main-wrapper');
var $scrollBody = $(BrokenLinkTable.brokenLinkTableSelector + '_wrapper .dataTables_scrollBody');
var scrollAreaTop = $scrollBody.offset().top,
      scrollAreaBottom = $mainWrapper.offset().top + $mainWrapper.height(),
      adjustment = -50;
$scrollBody.height(scrollAreaBottom - scrollAreaTop + adjustment);

Thank you,

This discussion has been closed.