angular-ui / ui-grid

UI Grid: an Angular Data Grid
http://ui-grid.info
MIT License
5.39k stars 2.47k forks source link

grid.renderContainers.body.visibleRowCache not updating (3.0.7) #5120

Open amex132 opened 8 years ago

amex132 commented 8 years ago

Re: ui-grid 3.0.7 (tree implementation)

I have been unable to figure out why grid.renderContainers.body.visibleRowCache does not refresh when splicing in more data ($scope.gridOptions.data) as child of a specific node in the tree (I've added a few rows, but count does not change even though I see these rows displaying within the grid).

It does set the cache to my initial data size (61 rows) but does not subsequently update as I add more data.

How does visibleRowCache work? I thought it displays exactly what is being displayed in the Tree/Grid? What am I missing, do I need to invoke something additionally to update rows in visibleRowCache?

Thanks!

lexigren commented 8 years ago

I'm having issue with visibleRowCache right now: during recalculation of canvasHeight, it's calculating by summing all the elements of visibleRowCache. The problem is, that there all the rows in table, holding in my visibleRowCache. So, canvas height is calculated for full table, while only viewport part of it is displayed. The result is giant white gap in the end of the page, when I scroll to the bottom. When I manually decrease height in styles - table looks normally. Is there way to override canvasHeight calculation or fix it?

lukelalo commented 7 years ago

I'm currently using angular ui-grid 3.2.9 version.

I'm having the same issue as @amex132. I'm splicing in some rows and I see those rows being displayed within the grid.

Also when I keep adding more rows, I end up by having the issue reported by @lexigren, with my canvasHeight being decreased until I only can see 4 rows of the 21 I have.

1.- Added some nodes captura de pantalla 2016-10-26 a las 8 57 30

2.- Added another one and... captura de pantalla 2016-10-26 a las 8 58 37 the lower rows dissapear :(

The tree structure has 3 root nodes, so it's well defined captura de pantalla 2016-10-26 a las 9 01 47

The rows are there captura de pantalla 2016-10-26 a las 9 02 15

The visible row cache has all the rows, but the rendered rows are only 4 :( captura de pantalla 2016-10-26 a las 9 08 28

EDIT: Doing some tests I've seen the problem is when I splice more rows than defined on the virtualisationThreshold parameter. If I set it to 50, the problem comes when I add the 51th row

jmalkan commented 6 years ago

Please provide a plunkr with latest ui-grid.