2

I have a container with a random number of items, and I'm using Gridstack.js to arrange them automatically based on the rows/columns size for each item.

My current scenario is a 3-column page with 4 items, so I have one item in the first column, 2 stacked in the second and a final one in the third column.

What happens is that the 2 stacked items end up on different columns, while the fourth items is stacked in the middle one. It seems like the plugin is filling the grid giving priority to columns, so each new item will be placed in the first empty column before going to the next row.

Here's a fiddle (couldn't get it to work with snippets) to clarify the question: https://jsfiddle.net/c57ter62/1/

Basically, the expected result should have 3 and 4 swapped.

Does anyone know how to achieve this result?

STT
  • 215
  • 1
  • 11

0 Answers0