We have updated Flexmonster Software License Agreement, effective as of September 30, 2024. Learn more about what’s changed.

on updating to 2.8.20, reportPivot.setReport invokes reportChange event

Answered
amir asked on November 19, 2020

I have a flexmonster chart in my angular application. On FM ready event I am calling 

reportPivot.setReport with my report data and when ever user makes a change from FE like applies filters I used to handle that in reportChange event. I was using 2.8.10.

 
Now on upgrading to 2.8.20 reportPivot.setReport function invokes reportChange event. How can i prevent setReport function to invoke reportChange event 

4 answers

Public
Milena Pechura Milena Pechura Flexmonster November 23, 2020

Hello, Amir,
 
Thank you for your question.
 
Our team has managed to reproduce the reported behavior.
We would like to mention that in the 2.8.20 version when you call setReport on ready event, the reportchange is invoked only if you have also specified the report with the same data source as it is shown in the following code snippet:

var pivot = new Flexmonster({
container: "#pivot-container",
componentFolder: "https://cdn.flexmonster.com/",

// approach 1
ready: () => {
setReport();
}, 

// approach 2
report: {
dataSource: {
filename: "https://cdn.flexmonster.com/data/data.json"
}
}
});

function setReport() {
flexmonster.setReport({
dataSource: {
filename: "https://cdn.flexmonster.com/data/data.json"
}
});
}

This behavior is expected: if you set the report with the same data source twice, it means that the report is changed. But indeed, we have not had this functionality in the 2.8.10 version.
 
With that in mind, we suggest two solutions:

  1. For the initialization of the component, please set the report only once: using either approach 1 or 2 (commented in the code above).
  2. Handle the reportchange in the reportcomplete handler. We have prepared an example for illustration: https://jsfiddle.net/flexmonster/qdgx8bvu/.

 
Please let us know if our recommendations work for you.
 
Kind regards,
Milena

Public
Milena Pechura Milena Pechura Flexmonster November 30, 2020

Hi, Amir,
 
Hope you are doing well.
 
We were wondering if our response helped you with your question.
Could you please let us know if one of the suggested approaches works for you?
 
We would be glad to hear your feedback.
 
Best regards,
Milena

Public
amir December 3, 2020

I had done some changes to fit my requirements haven't tried your suggestion yet. will let you know if there is anything else in this regards
 
 

Public
Milena Pechura Milena Pechura Flexmonster December 29, 2020

Hello, Amir,
 
We would like to kindly take an interest in whether you had a chance to try the suggested approaches.
Could you please let us know if our response helped?
 
Looking forward to hearing from you.
 
Kind regards,
Milena

Please login or Register to Submit Answer