Update data behaviour changed in version 2.3 compared to version 2.2
We recently migrated from version 2.2 to 2.3.
We had a perfectly working pivot, but after installing the update several functionalities were broken which is quite strange for a minor version update..
The problem occurs when updating the data of the report. We sometimes only want to update the data and leave everything else as is (rows, columns, filters, …).
We always did this by just setting the data param of the report directly and then calling setReport(report).
We tried using the updateData() call instead and then the data is updated fine, but the config of our pivot is lost.
I think as this is a minor version update, setting the data parameter should still work as it did in version 2.2, no?
Thanks in advance for your answer
Thank you for your feedback. 2.2 and 2.3 versions are major updates. That is why some important changes have been made in 2.3 version. To know more about the changes, please visit our migration guide http://www.flexmonster.com/doc/migration-guide/ . Speaking about the issues you have described:
1. The report structure has been changed. Here is the jsFiddle example https://jsfiddle.net/flexmonster/63qt6rbw/.
2. updateData() API call should not reset the configuration, only the data should be changed. The issue was reproduced on our side and it will be fixed in the next minor release 2.305 (ETA Dec 19).
Does the above work for you?
Thanks for the reply.
Unfortunately, I have the same issue when I set report.dataSource.data, the data is updated but my config is lost..
Thank you for your reply. Could you please provide us with the code example so we can reproduce the issue on our side? Please update the jsFiddle we have sent you previously the way you are using the component. Also could you please tell us what version you are currently using? To get the version information press Ctrl+Alt+i.
I found the cause of this issue. The problem was that we let users save the config of the pivot in our db.
Later users can reuse this config. The problem is that these configs are stil the old version so there is no dataSource field in them yet. I just had to adapt our code to support both formats. Now it seems to work.
It’s nice to hear that our workaround works fine for you. Please note that it’s a temporary solution. In such cases, we recommend using updateData API call, which will be fixed in version 2.305 (ETA Dec 19) .
I have one additional problem with this approach.
We use sorting on the columns like so:
This works fine when initally loading the pivot, but with the same approach as in https://jsfiddle.net/flexmonster/63qt6rbw/, when you set a large amount of data (+ 50k records), the sorting information is lost. (with a small dataset it’s fine)
It seems the SetReport() call is async and when the dataset is large enough, not everything is executed in the right order. Is this possible?
Thank you for reporting.
We have managed to reproduce the issue with the large dataset (https://jsfiddle.net/flexmonster/gefwpxyc/).
The fix will be available in the next minor release (ETA Dec 19).
Does it work for you?
Please download the fix for updateData() method from here: https://s3.amazonaws.com/flexmonster/bluecrux/FLEXMONSTER-2016-BLUECRUX-DEC08.zip
We will include it in the next minor build.