-
1. Re: Scroll at bottom of rich:scrollableDataTable
konstantin.mishin Feb 2, 2010 10:29 AM (in response to lfryc)1 of 1 people found this helpfulScrollableDataTable hasn't API for it. You can get/change "scroll state" of table using scrollTop property of DIV-element with id={idOfScrollableDataTable} + ":scb". For exemple:
document.getElementById("j_id353:carList:scb").scrollTop
-
2. Re: Scroll at bottom of rich:scrollableDataTable
lfryc Feb 3, 2010 10:07 AM (in response to konstantin.mishin)Thanks for reply, Konstantin - it drivers me on the right way.
But can you also advice me how to get actual maximal scroll height of scrollableDataTable?
I found that it can be obtained like:
document.getElementById("j_id353:carList:scb").scrollHeight
But when I scroll at bottom, scrollTop=2160 and scrollHeight=2520.
-
3. Re: Scroll at bottom of rich:scrollableDataTable
konstantin.mishin Feb 3, 2010 10:14 AM (in response to lfryc)As I think, should be : scrollHeight = clientHeight + scrollTop -
4. Re: Scroll at bottom of rich:scrollableDataTable
kragoth Feb 3, 2010 6:28 PM (in response to konstantin.mishin)Just in case you run into the same problem that I had. Under certain circumstances the scrollHeight = clientHeight + scrollTop does not quite scroll all the way to the bottom. You end up with the lasts row only partially visible.
function autoScrollToBottomAllRequiredTables() { jQuery("tr:last", jQuery(".autoScrollToBottom")) .each( function(){ jQuery(this).parents("div:first").animate({scrollTop: jQuery(this).eq(0).offset().top-100},100); }); }
That jquery function might help you if you run into this problem. Hopefully you don't