Adjust widget height via javascript in DNG
I have declared the widget height in the xml-file:
<ModulePrefs title="Formal Review" height="300" scrolling='true'>
Now I want to adjust the widget height according to the height of the table via the
javascript file. I can get the table height and the widget height:
let tableHeight = tableElement.offsetHeight
console.log (tableHeight) // answer (e.g.) 412
console.log (window.innerHeight) // answer 300
But all trials to change the widget height does not work. I have tried something like:
window.reSize(200,500)
window.style.height = 500
I am looking forward to any help.
Accepted answer
You need to use gadgets.window.adjustHeight()
Use with no argument to auto size, or use with an argument to set a specific height, eg. gadgets.window.adjustHeight(200);
Comments
2 votes