angular-ui/ui-grid

Column width reset when updating grid.data - fix

Open

#4.317 geöffnet am 3. Sept. 2015

Auf GitHub ansehen
 (4 Kommentare) (1 Reaktion) (0 zugewiesene Personen)JavaScript (2.496 Forks)batch import
good first issue

Repository-Metriken

Stars
 (5.395 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

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

Contributor Guide