I am trying to use gridstack.js to dynamically build a tile wall. Some of the tiles I want placed in specific locations, while the rest I simply would like to place in any unoccupied tile. The filler tiles will always have a width of 1 and height of 1, but the other items may be larger.
I am attempting to do something like this:
<ul class="tiles-container">
<!-- Specific Placement -->
<li class="grid-stack-item" data-gs-x="1" data-gs-y="0" data-gs-width="2" data-gs-height="1">
Some Text
</li>
<li class="grid-stack-item" data-gs-x="2" data-gs-y="2" data-gs-width="1" data-gs-height="2">
Some Text
</li>
<!-- Filler Tiles -->
<li class="grid-stack-item" data-gs-width="1" data-gs-height="1">
Some Filler Text
</li>
<li class="grid-stack-item" data-gs-width="1" data-gs-height="1">
Some Filler Text
</li>
</ul>
Where I have all of the specific placements at the top followed by the filler tiles. The filler tiles would not have an x and y location.
I could manually create my own grid by looping through the filler tiles and placing the specific ones where they need to go, but I am hoping the js will do this for me.
Has anyone done this before? Is there a way this can be done?