I’m trying to allow the user to select if the root container in a view is in percent or fixed mode. I have this change script on a check box in the container:
if currentValue.value:
self.parent.props.mode='percent'
else:
self.parent.props.mode='fixed'
In the designer, it changes the mode as expected. However, when I save this and try to use it in the browser, the check box has no effect on how things are displayed. Why is this? Is there a better way to let users control the mode?
Believe that's one of the things that while it appears it is "settable" during runtime, it actually isn't. You'd have to duplicate the container and set one to percent, one to fixed, and swap between them via the user input.
1 Like
Ended up following this. One additional detail: the container holding both of the sub containers needs to be set to percent.
1 Like
If you're doing it for the overall view, and you want to switch between them because of screen size, you could do it automatically via a breakpoint container as your root container.
1 Like