Search code examples
javascriptdialogoracle-apexscrolltoporacle-apex-20.1

Oracle APEX 20.1 Inline dialog scroll to top/bottom


I am trying to add a floating button with js DA, scrolling to top/bottom of the inline dialog.

I tried with $(window).scrollTop(xx); and it's scrolling the page not the dialog, I also tried with $(dialog_ID).scrollTop(xx); but nothing happens.

Any ideas how can I work this out? Thanks


Solution

  • First set a Static ID to your inline dialog, lets say PREGLED. Then use the following line and the content of your inline dialog should scroll to the bottom.

    $("#PREGLED .t-DialogRegion-bodyWrapperOut").animate(
        { 
            scrollTop: $('#PREGLED .t-DialogRegion-bodyWrapperOut').prop("scrollHeight")
        }
     , 1000);