ag-grid: Rows don't render if grid is hidden and then shown

I have a table, showing only AFTER it was loaded. Meaning - If I don’t have data, I don’t show a table.

It seems like ag-grid thinks it is hidden (and it is), so it renders just the first few rows, and stops after 6. If I am already scrolled down, it does not show a thing (because it renders the first rows)

Is there a way to implement an event for “when ag-grid visibility changes” and reload the view? (I see a lot of implementations online, most suck)

Here are the two cases, in video form: https://www.youtube.com/watch?v=qjvlmxW_KJg

I have a fix, and it is dumb.

showGrid();
$timeout(function() {grid.api.setRowData(my_data);});

This garanties at least one $digest cycle, making the grid visible, then adding the rows. (And it is dumb)

I don’t think I am the only one who encountered this, that’s why I don’t implement it myself…

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 15 (9 by maintainers)

Most upvoted comments

Did this issue has any fix ?