Slickgrid: array scheme inconsistent when data exceeds initial row count

StackOverflow https://stackoverflow.com/questions/21212692

  •  29-09-2022
  •  | 
  •  

문제

I initialize an editable Slickgrid with n rows. A user keys or pastes >n rows of data. The grid adds rows to hold the extra data, but when I then grid.getData() the resulting array has a different format for rows >n. For example, when n=2 it looks like this

[["A","I","X"],
 ["B","J","Y"],
 {"0":"C","1":"K","2":"Z"}]

I need this array to be uniformly constructed. I tried this but without effect:

grid.updateRowCount();
grid.render();
thatdata=grid.getData();

Hopefully I'm missing something simple in the docs--any help appreciated!

Edit: I should have mentioned I'm using the Celebio/Nereo labs fork, so this isn't purely a Slickgrid question.

도움이 되었습니까?

해결책

SlickGrid does not add the data to the array for you. You do that by subscribing to onAddNewRow and providing the implementation to add a new item to the array, so it's your code that adds the data in the wrong format.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top