angular-ui/ui-grid

expanded/collapsed state not restored on saveState.restore

Geschlossen

#6.718 geöffnet am 04.05.2018

 (3 Kommentare) (2 Reaktionen) (1 zugewiesene Person)JavaScript (2.496 Forks)batch import
good first issue

Repository-Metriken

Stars
 (5.395 Sterne)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

Beschreibung

I traced the code in grouping.js and found the issue at line 808 when the applyRowExpandedStates is called, the first argument "grid.grouping.groupingHeaderCache" is an empty object.

My theory is that the grouping that was just applied a few lines above didn't apply yet and therefore the groupingHeaderCache was not yet set.

To prove my theory, i added a setTimeout to line 808 as follows:

if ( config.rowExpandedStates ){
          setTimeout(function(){service.applyRowExpandedStates( grid.grouping.groupingHeaderCache, config.rowExpandedStates )});
        }

and that made it work.

Can you guys look into this and provide a fix if this is indeed a bug? and I think it is because even on your tutorial page http://ui-grid.info/docs/#!/tutorial/208_save_state, the state of expanded rows is not restored. To reproduce it there, you need to group on a column, expand one and Save. Then ungroup and restore. .

Contributor Guide