Currently, I am facing an issue with my SAPUI5 app. In the app, I have a table that extends beyond the screen. To allow users to navigate back to the top of the table, I have added a button. However, I only want this button to be displayed when the table goes off the screen. Unfortunately, the button is always visible, even when it's not needed. Despite searching for solutions, I haven't found one that works.
In my XML view, I have defined the button as follows:
<html: a id="toTop" href ="#_xmlview0--top">
<Button id="backToTopBtn" text = "back"/&>
</html:a>
Additionally, at the top of my view, I have defined:
<html:div id = top"></html:div>
I have tried using various jQuery solutions, but none have been successful. One approach I attempted was:
if($('body').height()>$(window).height()){
//go back to top here
}
However, upon inspecting the values, I noticed that both the body height and window height are the same. Any suggestions on how to tackle this problem?