- Home
- Forum
- React - EJ 2
- Pivot table date group settings is removed when data changes
Pivot table date group settings is removed when data changes
Dealing with dynamic data, where we want to group dates depending on the dynamic data. In doing this, we are dynamically setting groupSettings when the data changes. When the data changes, the data grouping is unexpectedly reset for some reason.
Successful reproduction of issue:
https://stackblitz.com/edit/react-8tkbuw-3tyw2q?file=index.js,data-source.js
Hi John,
We have checked the reported issue at our end and the issue occurs because you are updating the data source dynamically along with the dataSourceSettings. However, we considered this issue as a bug titled “Group settings not updated properly while dynamically updating the data source in the pivot table”. And this issue fix will be included in our May second weekly patch release which is scheduled to be rolled out on May 15, 2024. You can track the status with the feedback link below.
Until, then we request you to use the below work-around solutions to resolve the reported issue at your end.
Solution 1:
Clear the “groupingFields” object while dynamically changing the data source in the pivot table. Please refer the below code example.
Code example:
|
function onClick() { setSettings({ ...settings, dataSource: getPivotData(), }); pivotObj.engineModule.groupingFields = {}; } |
Meanwhile, we have prepared a sample for your reference.
Sample: https://stackblitz.com/edit/react-8tkbuw-6tocsw?file=index.js,data-source.js
Solution 2:
Use the “dataSourceSettings” property from the pivot instance to update the data source dynamically using the state variable. Please refer the below code example.
Code example:
|
function onClick() { setSettings({ ...pivotObj.dataSourceSettings, dataSource: getPivotData(), }); } |
Meanwhile, we have prepared a sample for your reference.
Sample: https://stackblitz.com/edit/react-8tkbuw-95qbw5?file=index.js,data-source.js
We appreciate your patience until then.
Regards,
Angelin Faith Sheeba.
Hi John,
Thanks for the patience. We are glad to announce that our weekly Release V25.2.4 is rolled out and the fix for the reported issue “Group settings not updated properly while dynamically updating the data source in the pivot table” has been included in this release. And, we have prepared a sample with latest version for your reference.
Sample: https://stackblitz.com/edit/react-vontrw-tuq2tm?file=index.js,data-source.js
Output screenshot:
Issue root cause:
The issue was caused by the "groupingFields" property in the engine module not being properly cleared while updating the data source, which has now been resolved by clearing the "groupingFields" while dynamically updating the data source.
We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.
Regards,
Angelin Faith Sheeba.
- 2 Replies
- 2 Participants
-
JO John
- Apr 24, 2024 08:19 AM UTC
- May 15, 2024 10:14 AM UTC