Skip to main content
14-Alexandrite
November 3, 2021
Solved

Dynamically change the size of a container to fit content

  • November 3, 2021
  • 2 replies
  • 3202 views

I want to be able to turn scrolling off for everything except the main(parent) container. This way the page scrolls like a normal web app would. I have a parent container with many other containers within it. I can set the parent container to "scroll current container" and this works sometimes. One instance it does not work is if I have a collection widget in one of the child containers. I do not know ahead of time how many collections will be in this child container and thus I cannot make it a fixed size. The collection, therefore, scrolls even though I do not want it too. How can I turn off the scrolling for the collection and have it fit the container completely, or dynamically resize the container so I only have a single page scroll?

 

Another example is if I have a label widget that pulls large text bodies from a DB that can vary greatly in size. How can I make the text dynamically resize the container it is in so that no scrollbar appears? This problem seems to only exist when an inner container has static positioning, as far as I can tell, but I need this to stay static. I will attach an example of this.

Best answer by slangley

Hi @JO_9930585.

 

Which version of ThingWorx are you running? There are some upcoming changes in 9.3 (targeted for late December) that will allow more control over this.  There is an option to disable it in that release.

 

Regards.

 

--Sharon

2 replies

14-Alexandrite
November 3, 2021

The second example is definitely easier to work around as I can make the positioning responsive and set margins etc.. in my css. The collection widget is going to be the tough one here.

slangleyCommunity ManagerAnswer
Support
November 19, 2021

Hi @JO_9930585.

 

Which version of ThingWorx are you running? There are some upcoming changes in 9.3 (targeted for late December) that will allow more control over this.  There is an option to disable it in that release.

 

Regards.

 

--Sharon

Support
January 5, 2022

Hi @JO_9930585.

 

ThingWorx 9.3 is now available for download.  Please take a look to see if your issue is now resolved.

 

Regards.

 

--Sharon