angular-ui/ui-grid

Column width reset when updating grid.data - fix

Fermée

#4 317 ouverte le 3 sept. 2015

 (4 commentaires) (1 réaction) (0 personne assignée)JavaScript (2 496 forks)batch import
good first issue

Métriques du dépôt

Stars
 (5 395 étoiles)
Métriques de merge PR
 (Métriques PR en attente)

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

Guide contributeur