Dynamic panel that sizes to fit content

Bart Popenoe shared this question 3 years ago
Answered

I have a dynamic panel that contains several "expander" styled controls that can be collapsed or opened depending on how the user chooses to display the content. To achieve the result that I'm after, the containing dynamic panel would need to adjust it's height based on the content (not a fixed height like the Dynamic panel uses by default). This would be how a DIV would would behave in HTML so I'm sure that it's possible but I'm not sure how achieve this... any ideas?

Comments (1)

photo
1

I eventually got this figured out so I'll post the solution for other's. The solution is to:


1. Place the 'expander' items inside an enclosing dynamic panel which has been set to use vertical layout.


2. Add an action to hotspot that triggers each expander to open/close. This action should increase the height of the parent dynamic panel by the same amount as the expander's increase in height. Do the same for the close hotspot, this time decreasing the height of the parent dynamic panel.