ScrollY position to Top when change page
ScrollY position to Top when change page
Hi,
I've st scrollY and when I select 100 rows for page correctly he shows me the scrollbar.
$(document).ready(function() {
var table = $('#clienti').DataTable( {
data: dataSet,
responsive: true,
"scrollY": scrollY + "px",
"scrollCollapse": true,
"processing": true,
columns: [
My problem is when I move scroll for example in the middle and then I change page it keeps scrollbar position while I would like it to be positioned to Top.
I suppose that:
$(document).ready(function() {
$('#clienti').on( 'page.dt', function () {alert('Do something on scrollbar'); });
} );
moreover if I try to use $.fn.dataTable.FixedHeader and move the scrollbar and change page I create a double header at the beginning of my web page, unless you first place the scrollbar by hand to top before changing page!
Sorry for my english
This discussion has been closed.
Replies
Hi @Giulo ,
We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.
Cheers,
Colin
Hi @Colin,
Thanks for your quick response but I can't do a test case, I think I write wrong but my request is only if it possible to set scrollY position on Top by and datatable event where I enable "scrollY" option.
Test case is to do a datatable with pagination and number rows selector and then?
P.S. Ignore my consideration of $.fn.dataTable.FixedHeader that I've removed some days ago
I don't know if it's correct but my workaround is:
As I always say, if it works, that's a good sign - glad all working