angular-ui/ui-grid

When restoring scrollFocus, a row that was previously on top, is now on the bottom of grid

Open

#5 911 ouverte le 22 déc. 2016

Voir sur GitHub
 (1 commentaire) (0 réactions) (0 assignés)JavaScript (2 496 forks)batch import
help wanted

Métriques du dépôt

Stars
 (5 395 stars)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

Description

I have a grid that's sitting inside a non-modal, I use saveState so I can destroy and recreate the grid.

I'm expecting the row that was the first row to be at the top when restoring, however it appears on the bottom of the grid.

I looked around in ui-grid.js (4.0.1), and noticed that in Grid.prototype.scrollIfNecessary when calculating the "scrollPixels", you deduct(-) the "bottomBound".

If I replace the bottomBound with my rowHeight, I get the expected result.

I might be doing something wrong, but if not, a fix is needed.

EDIT: The issue occurs only when the row that was before on top is below the current view port when restoring the state, as in - pixelsToSeeRow > bottomBound, This is happening in http://ui-grid.info/docs/#/tutorial/208_save_state as well

Guide contributeur