Muuri: Dynamically add an element to the grid from array

Created on 24 May 2018  路  3Comments  路  Source: haltu/muuri

I have an array of data, and a form

Every time I fill the fom, a new element is added to the array

This array is used to display a muuri grid (Each element of the array is a muuri item)

Unfortunately, when I use the form, the new item does not behave as the rest of the items (it is just added in the container div, without any style or transformation)

is there a way to refresh the grid every time a new item is added ? So far, it is added in the DOM, but it is not affected by the Muuri gridding. Here are a few images to explain :

Before adding item :

image

After adding item (the item is the lamb, previous first item is hidden behind)

image

I tried using grid.layout() and grid.refreshItems() after adding the item, it doesn't change anything

question

Most helpful comment

grid.add(elements) might do the trick 馃檪

All 3 comments

grid.add(elements) might do the trick 馃檪

Yes ! Thanks a lot !

Seems resolved -> closing.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

osamamaruf picture osamamaruf  路  4Comments

stat92 picture stat92  路  6Comments

abhipanda picture abhipanda  路  3Comments

dedurus picture dedurus  路  4Comments

realsoelynn picture realsoelynn  路  4Comments