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