angular-ui/ui-grid

expanded/collapsed state not restored on saveState.restore

已關閉

#6,718 建立於 2018年5月4日

 (3 則留言) (2 個反應) (1 位負責人)JavaScript (2,496 個分叉)batch import
good first issue

倉庫指標

星標
 (5,395 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

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. .

貢獻者指南