I have a popup window to show custom filters on a table. The issue is when it opens, its at a height of 801px when it should be less than 500px depending on what menu items(s) are open.
I would try to set the height of the popup to auto
when you open it. You will likely have to open the popup via a script.
Even with a script like the following, I still couldn't get the parent container height to change to auto. I found forcing 'auto' through the css stylesheet file worked though. Was their something I was missing to have it change through the open popup script or is modifying the parent elements not possible this way.
viewPath = "Alarm Filter/Group"
# Define the position for the popup
popupPosition = {
"left": 100,
"top": 100
}
# Define additional parameters, including binding the height to window height
popupParams = {
"inheritedHeight": True, # Set to True for inherited height
# Add any other parameters as needed
}
# Open the popup view with position and additional parameters
system.perspective.openPopup(id="filterpopup", view=viewPath, position=popupPosition, params=popupParams)
# Set the height of the container to "auto" using a script
script = """
var popupContainer = document.getElementById("popup-filterpopup");
popupContainer.style.height = "auto";
"""
system.perspective.executeScript(script)