nhn / tui.grid

🍞🔡 The Powerful Component to Display and Edit Data. Experience the Ultimate Data Transformer!
http://ui.toast.com/tui-grid/
MIT License
2.4k stars 386 forks source link

Tui-Grid v4.21.17: `rowKey` is `NaN` when appending rows with `_attributes` from the second time #1968

Closed d2phap closed 9 months ago

d2phap commented 9 months ago

Describe the bug When appending rows multiple times with _attributes, only the first batch of rows has valid rowKey.

To Reproduce Steps to reproduce the behavior:

const create1000Rows = () => {
  const rows = [];

  for (let i = 0; i < 1000; i++) {
    rows.push({
     _attributes: {
       checked: true,
     },
     name: `Row ${i}`,
    });
  }
};

grid.appendRows(create1000Rows());
grid.getData(); // => all first 1000 rows have valid rowKey

grid.appendRows(create1000Rows());
grid.getData(); // => from row 1000, they all have `NaN` rowKey

Expected behavior rowKey of all rows are not NaN

Screenshots image

Desktop (please complete the following information):