Need a special offer?Find out if your project fits.
+

getData with slice provided modifies internal state of flexmonster

Answered
Igor asked on March 8, 2018

Context:
If you use .getData() function and provide "slice" option it will corrupt state of flexmonster component so that the only way to return it back would be to use .setReport(), which causes everything to be reloaded.

Problem:
The problem is that "reportFilters", "columns", "rows", "measures" properties from slice provided to getData will be applied to flexmonster internal report state, but UI won't refresh that change. If you call getReport() you will see new values.
All subsequent calls to getData will be prefiltered by previous calls to getData.
Internal state corruption means we cannot know now weather filter was modified by user or by this call.
If user will go and modify any other filter then those filters created by getData will be applied as well (which should never ever happen).

Desired solution:
No GET method should modify internal state of the object.
getData should not alter report configuration.
Subsequent getData calls should not be affected.
There is no way to return back without refreshing entire report.

Reproduce:
http://jsfiddle.net/gy3ufmqj/

If you click "Reproduce" button and then change filter for category (just add bikes) - you will see that green line disappeared as well.
We were unable to reproduce issue with subsequent getData calls. In our case it happens after 2nd or 3rd subsequent call.

Internal state corruption is obvious.

2 answers

Public
Tanya Gryshko Tanya Gryshko Flexmonster March 8, 2018

Hello, Igor,
Thank you for such a detailed explanation!
Our team has reproduced the issue on our side. We are grateful you reported it.
We do agree that getData should not alter report configuration and affect subsequent getData calls.
The fix can be delivered with minor release 2.417, ETA Mar 26th.
Please let me know whether it works for you.
Regards,
Tanya

Public
Dmytro Zvazhii Dmytro Zvazhii Flexmonster March 27, 2018

Hello Igor, 
We are glad to inform you that the getData fix is available in the version 2.417 which has already been released. You are welcome to update the component from our website.
Kind regards,
Dmytro.

Please login or Register to Submit Answer