简体   繁体   中英

ag-grid (8.2.0) not rendering some rows

Whenever I call setRowData() to add rows that exceed the number of rows that can be displayed by the grid div unless scrolling, some rows are not added to the DOM. Even if I scroll to the bottom of the grid, they don't show up.

If I resize the grid, these missing rows magically appear.

I notice the row count and the getRenderedNodes() count are not the same.

I tried calling refreshView() from a setTimeout but it didn't work.

Is there an option to force rendering on all row? or at least to make them show up when I scroll?

I've had encountered a similar issues with adding new rows after the grid has already rendered. Instead of calling setRowData() try calling addItems([..]) instead where the array passed to addItems are the new rows that you're wanting to add. For whatever reason, this isn't in the grid api documentation, but you can read more about it at https://www.ag-grid.com/javascript-grid-insert-remove/#gsc.tab=0

With that function by default, it won't automatically refresh. Try leaving the refresh as default at first and then refresh if the issue persists.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM