How to: Container grow dynamically to the hight of its content?

s.roetus shared this question 6 years ago
Answered

I am using dynamic panels to group / layout.


I managed to dynamically show / hide dynamic panels and there content,


and I am also able to panels below are "pushed down".


But the outermost surrounding panel (with borders) will not automatically grow in height, so I see the grown content only partially.


How to make containers "height-dynamic" like a table cell in a html table design?

Comments (7)

photo
1

I fought with the same problem this week.


The fact is that current containers will not "stretch".


My work around was to make the out-most container large enough to provide enough space for the biggest layout scenario. The pitfall of that is of course that your screen becomes too long compared to what the visible objects need.


Depending on your project you might also consider to fake this effect with the help of the tabs feature in Dynamic panels.

photo
1

Hello Markku,


thank you very much for the reply.


I did not completely understand your last advise, how exactly did you fake this effect with dynamic pannel tabs?

photo
1

Just so that explaining is simple, let's assume there are only two dynamic panels.


Make the first tab and let it represent the situation where both panels are closed.


The second tab represents situation when first panel is open and second is closed.


Third tab: both panels are open.


Fourth tab: first panel closed & second open.


If you have many panels then this method gets too complicated.


If I were you I would maybe forget the tab-method and set the page layout control to fluid vertical flow and then create containers that are hidden or visible. This is the easiest way to create dynamic UI. If this is hard to understand then just ask me. I will then explain further.

photo
1

Thats exactly what I have done.


I have an outer panel which is set to fluid vertical flow.


Inside there are two panels, first is hidden by default, second is visible.


I can dynamically make the first one visible too or hide it again.


But the outermost panel must have a height for both of the panels inside.


For me this is a problem, I need some possibility to grow the height of the outermost panel either dynamically with respect to the inner panels (I've learned this is not possible right now) or by some trick (events, manually setting height, ...).

photo
1

What if there was no outer panel?


Set the >>page<< to fluid vertical flow and then build the rest like you would build with bricks.


The page is infinite.

photo
1

markku, how do i set a __page__ to fluid vertical flow?

photo
1

I believe that with the changes made to most recent version of JIM this cannot be done anymore directly. In old version there were similar Layout controls for page as well as containers. Now for page those Layout controls were replaced by 'Center screen's content' checkbox in Properties panel.


So you need to check that checkbox and then add a container on the page which you set up to flow "fluidly" vertically (=select container and set the Layout parameters as needed).


Hope that helps.