1.10.12 Scroller prefetches only 9 rows

1.10.12 Scroller prefetches only 9 rows

matthew35matthew35 Posts: 3Questions: 1Answers: 1

I am using the latest versions of DataTables and this plugin fetched from the CDN last night.

scroller.displayBuffer is at its default of 9, but only 9 records are prefetched when the table loads. According to the documentation page that means that _scroller _thinks there is only one row: 9 * 1 = prefetch 9 rows.

This occurs even when all scroller options are default and the row height has not been changed through CSS tinkering.

Also, even with scroller.boundaryScale set to .1 the plugin does not fetch new data from the server until I scroll passed rows 50 to 70. This means rows 10 through 51+ are blank after the table initially loads. I semi-fixed this by setting boundaryScale to zero, but this is not feasible in a production environment and still does not prefetch enough records to fill the height of the table.

Options:

"autoWidth": false,
"serverSide": true,
"processing": true,
"scrollY": 400,
"ajax": {
    url: "index.php",
    type: "GET",
    "data": function (d) {
        d.what = "list_clients";
        d.include = input_cancelled.prop("checked");
    },
    "cache": true
},
"scrollCollapse": true,
"scroller": true,
/*"scroller": {
    loadingIndicator: true,
    displayBuffer: 9,
    boundaryScale: .1
},*/
"deferRender": true

This question has an accepted answers - jump to answer

Answers

  • matthew35matthew35 Posts: 3Questions: 1Answers: 1
    edited September 2016 Answer ✓

    I've discovered that scrollCollapse causes the unexpected behavior above. It makes the scroller plugin think there is room for only a single row in the table view.

    For those of you having the same issue: remove scrollCollapse from your array of DataTable options.

    Moderator: please prefix "[Solved] " to the subject of this thread.

  • allanallan Posts: 61,697Questions: 1Answers: 10,102 Site admin

    Thanks - that sounds like a workaround rather than a fix to me. i'll look into why this is the case - you could be able to use the scrollCollapse option with Scroller.

    Allan

This discussion has been closed.