FIO-8724: Fixed firing change event for DataGrid component #5933
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Link to Jira Ticket
https://formio.atlassian.net/browse/FIO-8724
Description
Issue: Any change to the data grid (e.g., adding or removing a row) or any change to a nested component within the data grid should trigger a data grid change event and refresh the select component based on the refresh on data grid configuration. Change events are only fired for the nested component itself, not for the entire data grid.
Solution: The Edit Grid component fires change events when a row is saved or removed. However, the Data Grid should be treated as a special case of the Edit Grid, where any change to a nested component triggers a row save. Therefore, we need to track change events in the data grid and fire an additional event for the entire data grid component. This will ensure that the select component can refer to the data grid for refreshing.
How has this PR been tested?
Unit testing
Checklist: