Scroller plugin is overwriting iDisplayLength.

Scroller plugin is overwriting iDisplayLength.

jcreadyjcready Posts: 44Questions: 0Answers: 0
edited June 2012 in Bug reports
I have between 50k-100k rows of data and the Scroller plugin is ignoring [code]"iDisplayLength": 500[/code]

On mobile devices the iDisplayLength gets overwritten to such small numbers that the table gets re-drawn after only scrolling a couple rows. Even when using Scroller on a 1680x1050 computer display, the plugin is still overwriting iDisplayLength to an incredibly small number. I don't want to bog the page down with 100k rows in the DOM, but I also don't want to see the FOUC every half second because the Scroller plugin decided 500 rows would consume too much memory. Instead, it overwrites my iDisplayLength to about 35 rows; forcing my browser to: remove, calculate, append and position a new table in the DOM 3 or 4 times for every scroll of my mouse wheel.

Like the rowHeight property, the iDisplayLength property should only be calculated/modified/set by the Scroller plugin if the property isn't already set or if it's set to 'auto'.

Replies

  • allanallan Posts: 61,695Questions: 1Answers: 10,102 Site admin
    Scroller will always override iDisplayLength - it is how it works (see http://datatables.net/blog/Introducing_Scroller_-_Virtual_Scrolling_for_DataTables for more information on how Scroller works).

    Basically Scroller will set the display length to be 3 times the number of rows in the visible viewport. That obviously isn't enough in the case you are using. I plan to add an option to Scroller which will allow you to manipulate the row cache from the default of 3 to something much higher - say for example 50. This will be available in a future version of Scroller.

    Allan
  • gnychisgnychis Posts: 9Questions: 0Answers: 0

    Allan, did you ever introduce a setting to do this? I am trying to find the same functionality.

    Thanks!

    George

This discussion has been closed.