Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 81728

Scroller + stateSave bug / regression

$
0
0

Hi,
I've noticed a regression when updating from DataTables 1.10.15 + Scroller 1.4.2 to DataTables 1.10.18 + Scroller 2.0.0

Problem: After reloading the page the table is not scrolled to the position it was before reloading.

Working example with old version: http://live.datatables.net/lawowifi/1/edit?html,js,output

Regression in example with newer version: http://live.datatables.net/zemoxidu/1/edit?html,js,output

Identical code is used in both examples:

$('#example').DataTable({
    stateSave: true,
    scrollY:   200,
    scroller:  true    
});

To reproduce: Open the regressed example page, scroll a bit down, click "run with JS" to reload the example. The scroll position resets to the top and info below table may show wrong numbers. If you do the same steps with the older version, scroll position will stay at the right stop after reloading. Be sure to clear you local browser storage before viewing the other example as they share the same storage.

Analysis: I've already found an error in dataTables.scroller.js line 677
this.scrollType should probably be this.s.scrollType
However, changing this line does not solve the problem. I guess this.s.scrollType needs to be set to 'jump' during an initial load of the page.

Many thanks for looking into this!

Best regards,
Fynn


Viewing all articles
Browse latest Browse all 81728

Trending Articles