angular-ui/ui-grid

Column width reset when updating grid.data - fix

Open

#4,317 创建于 2015年9月3日

在 GitHub 查看
 (4 评论) (1 反应) (0 负责人)JavaScript (5,395 star) (2,496 fork)batch import
good first issue

描述

Hi,

referencing issue #4005 and fix #4202 . It seems that you have mostly fixed this issue, but missed one detail. When you load grid state from e.g. database it resets columns ' widths to default when updating data.

In my opinion, the solution would be to set column's hasCustomWidth property in uiGridSaveStateService::restoreColumns.

              if ( grid.options.saveWidths ){
                currentCol.width = columnState.width;
                currentCol.hasCustomWidth = true;
              }

贡献者指南