How to add another form to the right side of the grid panel

Hi both! This is very much do-able. You need to add both components programmatically, so that you can designate the same row name for both of them. Otherwise, the programmatically-added component gets added to a new row, which gets created underneath the dragged-and-dropped component.

I’ll update the docs to make it clear that the row names are not the names of pre-existing rows created by the designer, but rather the names of new rows designated by you.

Here’s an app where I’ve implemented a right-hand nav with a Grid Panel. The ‘hamburger menu’ icon is a Link that toggles between self.nav_shown = True and self.nav_shown = False. When the nav is shown, it adds both components to the Grid Panel. When the nav is hidden, it just adds the Data Grid to the Grid Panel.

I dragged-and-dropped the components into the Form in the initial state, so that in the Design View you can see how things look. That’s just for convenience, it would work without it.

https://anvil.works/build#clone:LXSRWJUZKZU4S2QZ=P6KZKXGRCHMMM2N7D4IV6XRY

3 Likes