This one will definitely solve your problem. I have created this methods for myself.
Please note that this is made according to datatables scrolling. you need to update classes like '.dataTables_scrollBody' according to your code.
var scrollPosition =0;
function saveScrollPosition ( container ) {
if ( $( container ) != undefined && $( container ).find( '.dataTables_scrollBody' ) != undefined ) {
scrollPosition = $( container ).find( '.dataTables_scrollBody' ).scrollTop();
} else {
scrollPosition = 0;
}
}
function setScrollPosition ( container ) {
if ( $( container ) != undefined && $( container ).find( '.dataTables_scrollBody' ) != undefined ) {
$( container ).find( '.dataTables_scrollBody' ).scrollTop( scrollPosition );
} else {
scrollPosition = 0;
}
}