I’m trying to build a grid from a repeating panel that will flow (no scrolling). Ideally, the items in the grid will be a template with elements I’ve arranged. This is quite easy to do with a repeating panel that fills vertically. But can this be combined with a grid panel? Ideally, I want something like this (sorry for the poor drawing):
This post shows how to dynamically generate items in a flow panel. I’m guessing this is more what I need, but I actually want a template so I don’t have to figure out how to build the elements with code. Repeating Panel--horizontally
Now I’m going to connect the data from the data table. For the first column I will add the indexes 0, 3, 6, etc (maybe with a modulo or something), for the second column I will add indexes 1, 4, 7, etc. Third column etc. I will update with the completed code.
EDIT: Well that wasn’t hard. I used data bindings to connect each element to it’s corresponding column in the data table. Then I did a search on the data table and sliced those.
This is the code in the form that slices the results. The first position is the starting point, second is the stop, and third is the step value.
@media screen and (min-width: 768px) { /* only on tablets and larger*/
.anvil-role-3-cols > div {
display: grid;
grid-template-columns: repeat(3, 1fr);
column-gap: 3%; /*adjust as needed*/
}
}
I haven’t tested it but I think it’ll work… It basically says behave like a normal repeating panel unless it’s a tablet or wider…