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?

貢獻者指南