angular-ui/ui-grid

Column width reset when updating grid.data - fix

Chiusa

#4317 aperta il 3 set 2015

 (4 commenti) (1 reazione) (0 assegnatari)JavaScript (2496 fork)batch import
good first issue

Metriche repository

Star
 (5395 stelle)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

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

Guida contributor