naver / egjs-infinitegrid

A module used to arrange card elements including content infinitely on a grid layout.
https://naver.github.io/egjs-infinitegrid/
MIT License
2.23k stars 95 forks source link

I want to insert an item in the center based on the index of the group. #488

Closed daybrush closed 2 years ago

daybrush commented 2 years ago

Description

        // 0 1 2 [3 4 5] 6 7 8
        ig!.insertByGroupIndex(1, [3, 4, 5].map((child) => {
          return {
            groupKey: Math.floor(child / 3),
            key: child,
            html: `<div style="height: 10px;">${child}</div>`,
          };
        }));

Steps to check or reproduce