Jump to a row in a DataTables.net view


JavaScript • JQuery • Lotus Notes Form

Add this to your form head to pickup the docunid that you want to jump to via a URLQueryString

"<script type=\"text/javascript\">"+
	"var jumpto = \"" + @UrlQueryString("JumpTo") + "\";"+
"</script>" +

METHOD #1

$(document).ready(function(){
	loadTable();  /* this is your function to initialize the Datatables.net table */
	if(jumpto!=''){
		$('html, body').animate({ scrollTop: $("#"+jumpto).offset().top - 20 }, 100); 	// 1000 milliseconds (1 second) for the animation duratio
	}
});

Method #2

$(document).ready(function(){
	loadTable();  /* this is your function to initialize the Datatables.net table */
	if(jumpto!=''){
		$('#'+jumpto).css('scroll-margin-top','20px');
		document.getElementById(jumpto).scrollIntoView(true);
	}
});

Written by fbrefere001

Posted by fbrefere001 on Monday January 13, 2025