It appears the ScrollingDataTable
scrollTo
method is broken.
As an alternative, I've tried scrollIntoView()
and jQuery's scrollTop
on the correct dom elements without luck. I've also tried YAHOO.util.Scroll
and it doesn't work either.
The datatable is in a div that has a vertical scrollbar.
jQuery version:
var scrollToThisRow = dataTable.getTrEl(recordToScrollTo);
var scrollPos = $(scrollToThisRow).position().top;
$('#tableBodyDiv').scrollTop(scrollPos);
Here's what I tried using YAHOO.util.Scroll:
var scrollToThisRow = dataTable.getTrEl(recordToScrollTo);
var scrollPos = $(scrollToThisRow).position().top;
var attributes = {
scroll: { to: [0, scrollPos] }
};
var anim = new YAHOO.util.Scroll($('#tableBodyDiv'), attributes);
anim.animate();