Despite the COVID-19 outbreak, our team continues operating at full speed. We are always here to support and answer all your questions.

Feel free to reach out by filling this quick form.

Fill the form
Get Free Trial

on updating to 2.8.20, reportPivot.setReport invokes reportChange event

Re-Open
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 

3 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 4 days ago

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 2 days ago

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
 
 

Please login or Register to Submit Answer