angular-ui/ui-grid

saveState's restoreColumn unnecessarily calls for the pinning of columns/refresh of grid

Open

#5.314 geöffnet am 12. Apr. 2016

Auf GitHub ansehen
 (0 Kommentare) (0 Reaktionen) (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

restoreColumn's unnecessarily calls for pinning a column/refreshing the grid when a column is currently not pinned and the saved state is also not pinned.

When a column's pinned state is saved, if the column.renderContainer is null, it saves it as an empty string: savedColumn.pinned = column.renderContainer ? column.renderContainer : '';

However, inside the if statement to determine if a pinned column should change, it performs the check: currentCol.renderContainer !== columnState.pinned

Because the column.renderContainer gets stored as an empty string instead of null when being saved, I think the same logic to replace renderContainer with an empty string should also be performed when restoring the columns to prevent an unnecessary pinning/refresh.

Contributor Guide