Which is the best way to layout a grid with infinite scroll that should load items dynamically when it scrolls down ? i leave a rough image of what i'm trying to do.. black boxes are the items on a grid.

example.png

Thanks.