angular-ui/ui-grid

Column width reset when updating grid.data - fix

Fechada

#4.317 aberto em 3 de set. de 2015

 (4 comentários) (1 reação) (0 responsável)JavaScript (2.496 forks)batch import
good first issue

Métricas do repositório

Stars
 (5.395 estrelas)
Métricas de merge de PR
 (Métricas PR pendentes)

Description

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;
              }

Guia do colaborador