angular-ui/ui-grid

Wrong columns rendered after reload of gridOptions.data

Open

#3.519 aberto em 17 de mai. de 2015

Ver no GitHub
 (2 comments) (0 reactions) (0 assignees)JavaScript (2.496 forks)batch import
help wantedtype: bug

Métricas do repositório

Stars
 (5.395 stars)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 30d)

Description

If you have a wide table with a lot of columns and a horizontal scrollbar, and you scroll all of the way to the right of that table and update the data backing the grid, the wrong columns get rendered. Example: http://plnkr.co/m9dWODm9cqqzscPY09L1. It appears to chop off the last few columns until you adjust the scrollbar to move slightly to the left.

I think it's because GridRenderContainer miscalculates the horizontal scroll percentage in adjustColumns, which leads to the range of viewable columns being off by a few. In the scrollHorizontal function the horizScrollPercentage is calculated using both the canvas width and the viewport width, but in adjustColumns only the canvas width is used. Should both functions be using the same method for determining horizontal scroll percentage?

Guia do colaborador