igniteui-angular icon indicating copy to clipboard operation
igniteui-angular copied to clipboard

Grouping by Date Column Causes Incorrect Collapse/Expand Behavior After State Restoration

Open Zneeky opened this issue 1 year ago • 1 comments

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

  1. Implement the igx-grid component and configure a date column with groupable = true. (or use this sample on StackBlitz)
  2. Group the grid by this date column.
  3. Expand at least one group.
  4. Save the grid state and store the serialized value in a database or local storage.
  5. Restore the saved grid state.
  6. 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

Zneeky avatar Aug 09 '24 06:08 Zneeky

Adding another related behavior, reproduced for other column data types as well - In the referenced demo:

  1. Group By “Country”
  2. Collapse the “Canada” and “Italy” group hierarchies to leave only a single one expanded (“USA”).
  3. Click “Save” to persist the state.
  4. Click the “Expand all groups” icon in the first header cell in order to collapse all groups -> the grid.groupsExpanded property will be changed to false in result of that.
  5. Click “Restore” button to restore the state.
  6. At this point all groups will be expanded, which is not the correct state that was saved.

grid-state-expansion-restore-issue

ddaribo avatar Aug 14 '24 10:08 ddaribo