Grouping by Date Column Causes Incorrect Collapse/Expand Behavior After State Restoration
Description
When grouping by a date column and saving the grid state, the functionality works as expected. However, upon restoring the saved state, all groups are either collapsed or expanded simultaneously, making it impossible to collapse or expand individual groups. The grid state does not correctly restore the previous grouping state, leading to this unintended behavior.
- igniteui-angular version: 18.0.x
- browser: any
Steps to reproduce
- Implement the igx-grid component and configure a date column with groupable = true. (or use this sample on StackBlitz)
- Group the grid by this date column.
- Expand at least one group.
- Save the grid state and store the serialized value in a database or local storage.
- Restore the saved grid state.
- Observe the behavior of the groups
Result
The groups cannot be collapsed or expanded individually; all groups are affected simultaneously.
Expected result
The grid should restore the state correctly, with only the previously expanded groups being expanded. Individual group rows should be expandable and collapsible independently.
Attachments
StackBlitz sample
Adding another related behavior, reproduced for other column data types as well - In the referenced demo:
- Group By “Country”
- Collapse the “Canada” and “Italy” group hierarchies to leave only a single one expanded (“USA”).
- Click “Save” to persist the state.
- Click the “Expand all groups” icon in the first header cell in order to collapse all groups -> the
grid.groupsExpandedproperty will be changed tofalsein result of that. - Click “Restore” button to restore the state.
- At this point all groups will be expanded, which is not the correct state that was saved.