angular-ui/ui-grid

Wrong columns rendered after reload of gridOptions.data

Open

#3,519 创建于 2015年5月17日

在 GitHub 查看
 (2 评论) (0 反应) (0 负责人)JavaScript (2,496 fork)batch import
help wantedtype: bug

仓库指标

Star
 (5,395 star)
PR 合并指标
 (30 天内没有已合并 PR)

描述

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?

贡献者指南