[英]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. 每当我调用setRowData()
以添加超出网格div可以显示的行数的行(除非滚动)时,某些行才不会添加到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. 我注意到行数和getRenderedNodes()
数不相同。
I tried calling refreshView()
from a setTimeout but it didn't work. 我尝试从setTimeout调用refreshView()
,但是没有用。
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. 与其调用setRowData()
, setRowData()
尝试调用addItems([..])
而不是传递给addItems
的数组是您要添加的新行。 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 无论出于何种原因,它都未包含在Grid API文档中,但是您可以在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. 首先尝试将刷新保留为默认设置,如果问题仍然存在,请刷新。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.