Fix: Half rendered rows with Scroller displayBuffer = 1
Fix: Half rendered rows with Scroller displayBuffer = 1
reh
Posts: 1Questions: 0Answers: 0
Datatables 1.9.4 / Scroller 1.1.0
I've got a table with generated images in each row. I don't want them to be requested until they are visible so I set displayBuffer = 1 for Scroller. I often have a half row at the top or bottom of the table that is unrendered. To fix this I needed to make two changes:
this.s.viewportRows = parseInt( this.s.viewportHeight/this.s.rowHeight, 10 )+1;
to
this.s.viewportRows = parseInt( this.s.viewportHeight/this.s.rowHeight, 10 )+2;
var preRows = ((this.s.displayBuffer-1)/2) * this.s.viewportRows;
to
var preRows = ((this.s.displayBuffer-1)/2) * this.s.viewportRows + 1;
Hope this is of use!
I've got a table with generated images in each row. I don't want them to be requested until they are visible so I set displayBuffer = 1 for Scroller. I often have a half row at the top or bottom of the table that is unrendered. To fix this I needed to make two changes:
this.s.viewportRows = parseInt( this.s.viewportHeight/this.s.rowHeight, 10 )+1;
to
this.s.viewportRows = parseInt( this.s.viewportHeight/this.s.rowHeight, 10 )+2;
var preRows = ((this.s.displayBuffer-1)/2) * this.s.viewportRows;
to
var preRows = ((this.s.displayBuffer-1)/2) * this.s.viewportRows + 1;
Hope this is of use!
This discussion has been closed.
Replies
Allan